• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

That "terrible" Backbutton :(

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is often asked question but I would like
to clear it to myself.
Is it possible to prevent user to go a previous
page of his/hers browser with a backbutton using
session objects or javascript?
I have tried this couple of days with many kind
of javascript codes but it seems that they do not work properly.
The last hope to me was that I started to use session object variables(timestamps) etc. in server side.
That worked, but I could not get a effect to user that it would work immediately when user had clicked the backbutton. After user resubmitted the
page, it worked (I read flags from session object
and forwarded resubmit to errorpage).
So, could someone please, tell me if it is possible to make this backbutton disabling work?
How do you people have handled this kind of "disabling going back to previous page" situation in your project?
I need this feature in money transaction system.
Best regards
MikLa

would work immediately after
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mik
Did you try to do a search of this and the HTML/JavaScript forums? You'll find plenty of previous discussions on this topic.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...and the answer you'll find is the answer you've already come up with.
No, there isn't a stable and reliable mechanism for handling the 'Back' button.
The best I've seen is to use the MVC architecture with a 'Front Controller'. In this you have a single Servlet that receives all requests and decides what to return to the client. If you get your cache control sorted out, even if the client hits the back button, a new request will go though and they will get the next page instead...
 
Saloon Keeper
Posts: 28486
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Back button is your friend. It reminds you that people can access pages in your web app without going through the proper sequence.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic