|
|
|
|
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.
|
|

01-22-2008, 10:50 AM
|
|
Member
|
|
Join Date: Jan 2008
Posts: 3
|
|
|
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.
|
|

01-22-2008, 11:24 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 28
|
|
|
which jsp tag u want to use
|
|

01-22-2008, 11:39 AM
|
|
Member
|
|
Join Date: Jan 2008
Posts: 3
|
|
|
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
|
|

01-23-2008, 07:20 AM
|
|
Member
|
|
Join Date: Dec 2007
Posts: 28
|
|
|
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
|
|

01-23-2008, 07:29 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

01-23-2008, 08:35 AM
|
|
Member
|
|
Join Date: Jan 2008
Posts: 3
|
|
|
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
|
|

01-23-2008, 09:07 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
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. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-02-2008, 02:58 PM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 13
|
|
|
smrithi
Member OK FRIEND DO NOT WORRY.YOU REFER HEAD FIRST JAVA BOOK FOR JSP TAGS AND JSTL.BYEEEEEE.
|
|

06-02-2008, 03:00 PM
|
|
Member
|
|
Join Date: Jun 2008
Posts: 13
|
|
|
If You Refer Orielly Publications Books You Get The Perfection On Jsp Tags,jstl And Custom Tags Also.i Am Pradeep From Mysore .byeeeeeeee.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
All times are GMT +3. The time now is 03:51 AM.
|
|
VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org