Forums Register Login
ServletContext problem
In my servlet, I read the variable stored in the ServletContext and forward to JSP to display, but sometimes, after the variable is updated in ServletContext, the JSP page does not reflect it on some machine. Is this the problem of the browser? Any one can help?

It could be a caching problem with the browser, or it could be with your code. It's hard for us to say from here.

If it's a caching issue there are various techniques for telling the browser, and server not to cache content such as the no-cache meta tag:

There are issues with both MSIE and netscape that keep this from always working. See:http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q234067

You can also set the headers directly:

The surest way IMHO, is to make certain the url is always unique. This can be done by adding a bogus querystring variable to the end with a timestamp as a value.
This tiny ad is wafer thin:
Become a Java guru with IntelliJ IDEA

This thread has been viewed 694 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 20, 2019 06:04:18.