• Post Reply Bookmark Topic Watch Topic
  • New Topic

That "terrible" Backbutton :(

 
Mila
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • 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.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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...
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!