Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page caching

 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding this to your code:

 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic