• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A basic question about "request"

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was very confused about using "requset" in jsp/servlet program. I think the parameter/values of hidden input field in a form will everytime be submitted to my servlet. But when I press the back button and then submit, in my servlet I get the parameter values which is belong to the page before I push back button. In these two pages, there are the same input field. Who can give me an clarification or some advice or a link?
Thanks very much.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The veriables get cached while you switch between the pages.
Simple solution for this problem is write some code for body onLoad which will initialize the variables everytime you load the page.
Another solution is dont let browser cache that page.
You can do it by --
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "Thu, 26 Sep 1974 06:00:00 GMT");
regards.

 
reply
    Bookmark Topic Watch Topic
  • New Topic