• 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

Re: Servlet Problem

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
I am new to Servlet. I want to ask if I write 2 servlet pages, A and B, I write a button in A such that I can go to B by clicking the button. However, I don't want someone can go back to A by clicking Button "Back" in Browser. What should I do? This suggestion actually came from my observation of many web sites in whcih I cannot go back once I log in the web sites and error message "The page is expired" prompted when I click the Button "Back" in Browser.
Regards,
Joe
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"The page is expired" message is a browser message that cannot be controlled by any server-side component, including web servers, servlets, jsp, etc.

The reason that you get this message is that the page you are going "back to" was constructed as a result of an HTTP POST operation (a form submission whose method attribute was set to "POST").

Also note, it's not that you cannot go back to this page, it's that you cannot view the page again until you repost the form submission.
 
Joe Cheung
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Mike Curwen,
Thanks for reply. Now I am more understandable to the servlet operating theory. If I really want to disallow user to go back to the previous servlet by clicking "Back" button in browser, what should I do?
Regards,
Joe
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Originally posted by Joe Cheung:
Dear Mike Curwen,
Thanks for reply. Now I am more understandable to the servlet operating theory.

If I really want to disallow user to go back to the previous servlet by clicking "Back" button in browser, what should I do?
Regards,
Joe


This has been discussed many a times in this forum, kindly do a search on it, & you would come across many threads.
hth
MB
reply
    Bookmark Topic Watch Topic
  • New Topic