Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContext problem

 
Li Xin
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic