Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-22-2008, 10:50 AM
Member
 
Join Date: Jan 2008
Posts: 3
smrithi is on a distinguished road
Example for Ajax-JSP
Anyone knows as to how to use Ajax with JSP. I have found out that we can use JSP tags for using Ajax with JSP. I got an example for using Ajax with Jsp at Learn AJAX but here, they have not used JSP tags. The example works. But I want to know how to use JSP tags.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-22-2008, 11:24 AM
Member
 
Join Date: Dec 2007
Posts: 28
anki1234 is on a distinguished road
which jsp tag u want to use
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-22-2008, 11:39 AM
Member
 
Join Date: Jan 2008
Posts: 3
smrithi is on a distinguished road
I am a newbie to JSP tags. Want to actually know how to use them and where to start off to use them to get Ajax thing in my jsp pages
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-23-2008, 07:20 AM
Member
 
Join Date: Dec 2007
Posts: 28
anki1234 is on a distinguished road
Hi,
this is a small application in ajax which i made few months back.Hope it will help u
caller.jsp :
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
">

<html>
<head>
<script src="ajax.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page using AJAX</title>
</head>
<body>

<a onclick="sendRequest('GET','index.jsp')" href="#">Server Date Time:</a>
<div id="ajax_res">Server Date Time will replace this text.</div>
</body>
</html>

index.jsp
<html>
<body>
<%=new java.util.Date()%>
</body>
</html>

ajax.js
function createRequestObject(){
var req;
if(window.XMLHttpRequest){
//For Firefox, Safari, Opera
req = new XMLHttpRequest();
}
else if(window.ActiveXObject){
//For IE 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
//Error for an old browser
alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera');
}

return req;
}

//Make the XMLHttpRequest Object
var http = createRequestObject();

function sendRequest(method, url){
if(method == 'get' || method == 'GET'){
http.open(method,url);
http.onreadystatechange = handleResponse;
http.send(null);
}
}

function handleResponse(){
if(http.readyState == 4 && http.status == 200){
var response = http.responseText;
if(response){
document.getElementById("ajax_res").innerHTML = response;
}
}
}
run this application may be u get some clue
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-23-2008, 07:29 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,338
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
A good start pal. And it is better if you can [code] tags when you posting next time.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 01-23-2008, 08:35 AM
Member
 
Join Date: Jan 2008
Posts: 3
smrithi is on a distinguished road
I wanted to use JSP tags to build Ajax web site. But in the example you gave, you dint specify about any tag usage.. There are jsp tags which are used when we use ajax in jsp.
Thanks for ur example
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 01-23-2008, 09:07 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,338
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
It's better to find the tags usages by yourself pal
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 06-02-2008, 02:58 PM
Member
 
Join Date: Jun 2008
Posts: 8
pradeep1_mca@yahoo.com is on a distinguished road
smrithi
Member OK FRIEND DO NOT WORRY.YOU REFER HEAD FIRST JAVA BOOK FOR JSP TAGS AND JSTL.BYEEEEEE.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 06-02-2008, 03:00 PM
Member
 
Join Date: Jun 2008
Posts: 8
pradeep1_mca@yahoo.com is on a distinguished road
If You Refer Orielly Publications Books You Get The Perfection On Jsp Tags,jstl And Custom Tags Also.i Am Pradeep From Mysore .byeeeeeeee.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
NetBeans IDE 6.1 - AJAX Programing JavaForums Java Blogs 0 04-16-2008 12:00 AM
alternative for ajax site4u New To Java 1 03-17-2008 01:08 PM
JAVA, Ajax, Flash Digital Dispatching JavaServer Pages (JSP) and JSTL 0 02-06-2008 08:49 AM
how to contact servlet from clientside through ajax santhoskumara Advanced Java 2 08-10-2007 07:56 AM
Ajax question Peter New To Java 1 07-09-2007 01:43 AM


All times are GMT +3. The time now is 04:44 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org