aspose file tools*
The moose likes Servlets and the fly likes Warning: Page has expired Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Warning: Page has expired" Watch "Warning: Page has expired" New topic
Author

Warning: Page has expired

Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
I had posted this a month ago and did not get any response. I am posting it again.
If a user uses the back button to browse the previous pages(only the page which comes after a POST operation), he gets a message in IE...
"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."
I am setting the header to no-cache. Thinking that this is the problem, I changed the code like this
if (request.getMethod()=="GET")
{ response.setIntHeader("max-age", 0);
response.setHeader("Cache-Control","no-cache");
response.setIntHeader ("Expires", -1);
response.setHeader("Pragma","no-cache");
}
else{
response.setHeader("Cache-Control","Private");
}
I have gotten the following document from microsoft page http://support.microsoft.com/support/kb/articles/Q183/7/63.ASP
I had already disabled 'do not save encrypted pages to disk". still it doesn't work. and I am using IE 5.0. Even netscape has the same problem. a slight change in the error message though. Has anybody done any work around for this problem?
Beksy

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16134
    
  21

When you have page caching turned off, an attempt to use the "back" button has no page in cache, so a new page must be created instead of simply redisplaying what's in the cache. This is what you're being warned about - the page is going to be reconstructed by resubmitting the request that built that page to the webserver.
However, since this is actually submitting a new HTTP request, you may not get the exact same page back, since the data from which the page is being built may have been changed (by another user doing a database update, for example). That's what they're REALLY trying to tell you.


Customer surveys are for companies who didn't pay proper attention to begin with.
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
Thanks, Tim. So what could be the possible solution for this problem? Users may not like to see this message. Also, I am explicitly tell it not to cache only if it is 'GET'.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16134
    
  21

I think the error message is hardcoded in the browser.
POSTs have a different transport mechanism that GETs - a GET needs only to send the URL, but a POST must send a URL plus a document containing the POST form data.
I've never really paid attention to what circumstances might keep a POST from needing to resend - usually it's doing what I want it to in that respect anyway.
Steve Snodgrass
Greenhorn

Joined: Jun 12, 2001
Posts: 27
We use a very similar set of headers to prevent page caching and the interesting thing is that some developers browsers get the "Page has Expired" message while some automatically send a new request (a POST) to re-retrieve the page. Everyone is using either IE 5.0 or IE 5.5 on Windows 95 or NT (though we have proven that the discrepancy is not due to the browser version or OS). I imagine there must be some browser setting which is causing this though I have not had time to track it down.
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
I downloaded 5.5(sp2). It displays a small icon(not the warning message) and 'refresh' doesn't help to bring back that page.
Mandy Smith
Ranch Hand

Joined: Jun 26, 2001
Posts: 62
I have the same exact problem as you are facing Beksy. Did you find out any solution to solve this. If anybody has had the same problem and have got over it, could you please help us
in solving this problem.
Appreciate your help!
Thanks,
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
No, mandy. I still haven't gotten a solution for the problem. I could bring back the warning message(instead of the icon) if I disable the "do not save encrypted file to disk' option in IE 5.5. I am working on a work around right now. I may have to give a link back to the 'post' page and pass the data which it originally gets from the post operation.
Beksy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Warning: Page has expired