Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session variable

 
roon ray
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am setting a session variable in every page depending on if a user clicks a button or not. The pages work fine if I use the navigation button that I have on the designed website as I am setting the session variable in one of the taglibs.
But when I use the forward and back button of the browser, the session variable does not hold the value as the page is loaded from cache.
I tried clearing out the cache using meta tags in JSP but still it appears to me that the pages are not getting loaded as my printlns are not printing anything.
Can someone suggest some other way to handle this. I tried the clearing out of cache but that does not work.
Any help will be highly apperciated.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could not get the requirement properly but I am still answering to best of my knowledge about your question.


If you web application has navigation buttons then why do not you disable the browsers back button.
You can put a javascript : history.go(1); on page load event of every page.So as soon as you press the back button it will take you to the page from which you have clicked the back button.In this way you are staying in the same page.
I do not know whether this will work will dynamically generated pages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic