jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Disabling Back Button in a browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Disabling Back Button in a browser" Watch "Disabling Back Button in a browser" New topic

Disabling Back Button in a browser

Raja Rama

Joined: Dec 19, 2002
Posts: 2
Hi all,
I want to disable the back button in my browser. I have included the following in my code.
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
But it does not help me. Kindly anyone let me know how I achieve both the Back button in the browser and also the right click.
Thank you in advance.
A.Charles. isaac_charles@rediffmail.com
Dave Comeau

Joined: Jun 14, 2002
Posts: 27
What is your goal in removing browser functionality?
There are lots of tricks and hacks to "disable" the back button, try a search on google.
None of them are elegant or user friendly.
I would suggest you re-think the structure of the page you are trying to prevent people from returning to. Sessions seem to work well for me.
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
I am moving this thread to HTML/JavaScript Forum...

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
I agree. Here's the link: http://aspose.com/file-tools
subject: Disabling Back Button in a browser
It's not a secret anymore!