This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes browswer's back button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "browswer Watch "browswer New topic
Author

browswer's back button

manasa teja
Ranch Hand

Joined: May 27, 2002
Posts: 325
Is there any way to disable browser's back button.. could u please explain it..


MT
Peter Storch
Ranch Hand

Joined: Jun 12, 2003
Posts: 74
No, there is no real way with HTML / JavaScript. You also have to consider Bookmarks or that the user types in anything as URL. There is also the issue of caching which can be controlled only to some extend.
Your web application has to be build with this drawback of HTML/HTTP in mind.
Consider using e.g. Struts Token mechanism to detect multiple requests, or some kind of State Machine or Workflow controller on the server side to handle pageflow.
Don't rely on the browser, build a foolproof webapp.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
http://www10.brinkster.com/A1ien51/basics/backbutton.htm
Timothy Toe
Ranch Hand

Joined: Oct 19, 2002
Posts: 156
I agree 101% with Peter Storch. Peter has given some real solid advise. "Don't rely on the browser, build a foolproof webapp."
The link given by Eric Pascarello depends on JavaScript which does not work on some browsers. So becareful. You can use it only if your webapp is not mission critical... no real transactions.
Timothy Toe
Ranch Hand

Joined: Oct 19, 2002
Posts: 156
The back button problem that we face brings us back to some history. HTML/HTTP originally was only to handle web pages and nothing else. By webpages I mean simple read only dead webpages... that you read like a book.
This is why we have buttons like back, forward, bookmark etc etc.
Few did think that HTML/HTTP would evolve to handle web app like what we have now. By web app I mean real application that allows you to perform transactions, even monetary transactions (with Credit Cards etc).
With this, these convenience buttons became troublesome buttons..
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What you really need would be a sever side expire on the page if you are doing importnat trans.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: browswer's back button