This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to control Browser buttons from a Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "How to control Browser buttons from a Servlet" Watch "How to control Browser buttons from a Servlet" New topic
Author

How to control Browser buttons from a Servlet

Vanchi Nathan
Ranch Hand

Joined: Feb 24, 2004
Posts: 107
Hello all,
Is there a way for a servlet to disable the back button of the browser to control navigation.
Please advice... thanks in advance..


Best regards,<br /> <br />vanchin
Dominik Ratajski
Greenhorn

Joined: Feb 09, 2004
Posts: 14
no.
strictly speaking a servlet cannot disable browser buttons.
you'd have to do something through javascript using the history:
if (currentpage is in history) {
window.history.forward(1);
}
in general, you cannot control a users browser - ie font preferences, disabling buttons etc.
the other way would be to use a session based pages which expires so that if they go back they would get page cannot be found etc.
DSR
 
GeeCON Prague 2014
 
subject: How to control Browser buttons from a Servlet