File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes no-cache not expiring web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "no-cache not expiring web page" Watch "no-cache not expiring web page" New topic
Author

no-cache not expiring web page

John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
In the below servlet A i am able to get the no cache to work so when i hit the back button the page is expired.

I am using this same exact code in another servlet. The only differenc i can think of is the i am using the PRG patten with it. So i do a process then it redirects to servlet B and displays the invoice page. However if i hit back from here the page is not expired and will still display.

any ideas?

thanks john


SERVLET A


SERVLET B



[ December 06, 2008: Message edited by: John Schretz ]

[ December 06, 2008: Message edited by: John Schretz ]
[ December 06, 2008: Message edited by: John Schretz ]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
As you are aware, the whole point of the PRG pattern is to prevent double submit when you refresh the result page after a post request. Hence using a redirect instructs the browser to initiate a brand new request. So you are not getting a "page expired" error message anymore when you go back to the previous page which is not been cached by the browser.

I think this is what is happening. However, the more knowledgeableand very helpful folks here will probably have a better explanation.
[ December 06, 2008: Message edited by: Bosun Bello ]

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: no-cache not expiring web page