GeeCON Prague 2014*
The moose likes JSP and the fly likes Refresh Problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Refresh Problem." Watch "Refresh Problem." New topic
Author

Refresh Problem.

Alex Marks
Ranch Hand

Joined: Sep 12, 2005
Posts: 31
Hi Everyone,
I have the problem with refresh page. I have 2 JSP pages, a.jsp and b.jsp. In a.jsp, I display the information which is stored in the session. In b.jsp, I make some modifications to such information. When i come back a.jsp, the page still display the old information, but after press F5 or refresh button of the web's browser, it displays new information. I would like to ask if there is any way to over-come this problem.
Thank you for your help so much and have a nice day.


Before I come here, I am confused about Servlet/JSP. Ater I come here, I am more confused about it, but in systematically.
sudhir kamath
Greenhorn

Joined: Mar 07, 2002
Posts: 16
Originally posted by Alex Marks:
Hi Everyone,
I have the problem with refresh page. I have 2 JSP pages, a.jsp and b.jsp. In a.jsp, I display the information which is stored in the session. In b.jsp, I make some modifications to such information. When i come back a.jsp, the page still display the old information, but after press F5 or refresh button of the web's browser, it displays new information. I would like to ask if there is any way to over-come this problem.
Thank you for your help so much and have a nice day.


a simple solution for this problem call page reload function in body onload,you can do this with simple javascript.
regards,
sundeep kamath
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61306
    
  66

Forcing a reload in javascript would be a very untidy solution. Rather you need to control the caching of the page by the browser. Search this forum for topics on cache control.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alex Marks
Ranch Hand

Joined: Sep 12, 2005
Posts: 31
Thank you very much for your suggestion, i have found the solution.
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

Use this in the code so that cacheing does not occur.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Sripathi Krishnamurthy:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

Use this in the code so that cacheing does not occur.


This does not always work.


Groovy
 
GeeCON Prague 2014
 
subject: Refresh Problem.