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

page caching

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
I am opening a spreadsheet from my servlet by using :
res.setContentType("application/vnd.ms-excel");
The problem I am having is that after I hit the back button on IE, and then try to redirect to my spreadsheet page a subsequent time, I get the first spreadsheet page contents instead of the new content I expect. It seems that the page is caching, but I am not sure how to resolve that. Any ideas would be appreciated.
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
Try adding this to your code:

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Hi,
Thank you very much for your idea. It makes sense that the suggestion should work, but for some reason it didn't. I am not sure if something is up with my environment which is causing a problem. I did find a differant solution, which I thought I would post here in case anyone else is having a similar problem. I added a header to the response that redirects the data to a seperate spreadsheet file, instead of opening the spreadsheet from within the browser. This seems to have done the trick. Here is the code:
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Just for the record, wanted to note that this was found to be an environment problem, not sure what, something with my browser I am guessing. This code worked on another machine in my office.
Again, thank you very much for your time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: page caching