If I use jQuery.getJSON to call a servlet say with a button click to get some remote value, clicking the button will not fire the servlet again unless I change the parameter values sent to it. Why is this and can it be fixed?
You might want to add nocache headers to your response (see Servlets FAQ) and see if that makes a difference. The fact that the change in param value triggers a hit makes this sounds suspiciously like a caching issue.
one way to do it is, in Jquery Ajax call, you can specify no cache
a hack is add a variable to the url with a constantly changed value like: String url = requestUrl + "?now=" + new Date(); when you call jquery to make an ajax call, if the url is not changed, you will get the same result. [ November 30, 2007: Message edited by: Hongli Li ]
Do you know why this cup is useful? Because it is empty.