This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Can't do it. Possible Workaround...
Posted by Abha Thakur on September 12, 2000 at 2:20 PM
> Tell me how can i disable the forward or back button in a browser for my application
Couple of months back we researched the problem and found it can't be done. In earlier versions of the browser, you could delete the history entries in the browser and this disables the backbutton but they did away with it for security reasons. You can open the document in a new window and acheive that effect.
About our problem:
We had to prevent users from entering our application after having logged out by clicking the backbutton;
There is a property of the document object called 'referrer' and if you have a navigation diagram in place, then u know, which documents can call the concerned document and thus have a list of admissible referrers, and you do this check on load of the document and redirect the navigation to another page should the referrer not be a valid one. If this works for u, then good!