This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Action class not executing via AJAX. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Action class not executing via AJAX." Watch "Action class not executing via AJAX." New topic
Author

Action class not executing via AJAX.

Shyam kumar
Ranch Hand

Joined: May 21, 2006
Posts: 146
Greetings Ranchers,

In AJAX, I have sent a request with a url1(say url1) . It is executing the mapped Action class and retrieves some values. Now if I send another request with the same url1 it is not executing the Action class again and retriving the previous value from the cache(i.e. same values that were retrieved last time even if those values has changed now).
Can anyone please help me out on this?


Naveen
[ November 20, 2006: Message edited by: Bear Bibeault ]
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

can you post Java Script code?


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Set no cahce headers!


xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

Eric
Shyam kumar
Ranch Hand

Joined: May 21, 2006
Posts: 146
Hi, Attaching the Javascript code snippet as requestd by Prabhu

------------------------

function retrieveCourse() {
var ind = document.forms[0].college.selectedIndex;
var idField=document.forms[0].college.options[ind].value;
if (window.ActiveXObject) { // IE
var url="Course.do?college="+idField;
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) { req.open("GET", url, true);
req.onreadystatechange = processCourseChange; req.send(null); }
}
}
------------------------

Eric, can you please through some light on it.

Thanks,

Naveen
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What is there to shed light on other than: The browser is using the cache which it does to make a web age load faster so you need to tell it not to use the cache.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Action class not executing via AJAX.
 
Similar Threads
ArrayList and Ajax
Ajax validation to open a conditional popup
how to map multiple url patterns using spring annotations
Collection on jsp
Drop-down list empty when Validation Fails...