aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to control Browser buttons from a Servlet