Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action class not executing via AJAX.

 
Shyam kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post Java Script code?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set no cahce headers!


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

Eric
 
Shyam kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic