• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

page caching

 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try adding this to your code:

 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic