• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page expired when clicking back button of browser.

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

in my web application

i have one jsp view (view1.jsp)which contains 2 text fields...

when user fills up value and click on submit button of view1.jsp
the request goes to my servlet and processes the request and add 2 attributes to session and forwards the response using request despetcher. to view2.jsp which display data in table format...

while the user is on view2.jsp which display data in table format... and clicks back button... it get page expired... and when i click refresh button... the page with 2 text box comes... which should ideally displayed on clicking back button...

is there any perticular reason for my application's such behaviour ???

what are the steps i need to take to prevent this...

Thanks in advance...
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your pages are not cached in the browser , that is the reason for such behaviour.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is also a good thing. Otherwise, clicking the back button would result in a form being re-submtitted.

Look into the post-redirect-get pattern to insure that this doesn't happen.
There is an example in the JSP faq section.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic