aspose file tools*
The moose likes Servlets and the fly likes Caching the Servlet's response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Caching the Servlet Watch "Caching the Servlet New topic
Author

Caching the Servlet's response

amol l a lekurwale
Ranch Hand

Joined: Oct 16, 2008
Posts: 30
I have a application where, if a user click on a link on a JSP, a servlet is invoked. The servlet in turn processes the request parameters and then dispatches request to a JSP. When I click back button on the newly obtained JSP, on the browser, I get the message as :-


Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button.

________

After I refresh the page, I get the previous JSP.
Can anyone suggest a mechanism for auto refreshing the page when I click the back button, through the servlet?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
You should not refresh pages that are generated as the result of a POST. See http://faq.javaranch.com/java/DoubleSubmitProblem and the pages it links to for an explanation of the problem, and what you should do to avoid it.
amol l a lekurwale
Ranch Hand

Joined: Oct 16, 2008
Posts: 30
No Ulf, the page has been generated as a result of GET.
Also, no 'side-effect' causing data is exchanged.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
I'd guess that the original page makes use of HTTP header that indicate that the page should not be cached. See http://faq.javaranch.com/java/NoCacheHeaders for details.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Caching the Servlet's response