by Ashish Rathore on February 6th, 2005

Ashish Rathore

Question

Help answer this question below.

Using JSP/Servlet, how can I disable the BACK button of a user's browser?

Answers. 4 helpful answers below.

  • by Vishva Deepak on October 13th, 2009

    Vishva Deepak

    <%
    response.setHeader("Pragma","no-cache");
    response.setHeader("Cache-Control","no-store");
    response.setHeader("Expires","0");
    response.setDateHeader("Expires",-1);
    %>

    OR

    <script language="JavaScript" type="text/javascript">
    window.history.forward(1);
    </script>

    • Like
    • Report

    No comments. Post one | Permalink

  • by Niji-san on December 4th, 2006

    Niji-san

    I would highly advise AGAINST disabling the back button. It would only confuse your users, annoy the heck out of them and run contrary to their expectations.

    If you do disable it, use javascript.. but be aware that anyone (with firefox at least) can disable javascript and hence get their back button... err.. back. :-)

    • Like
    • Report

    No comments. Post one | Permalink

  • by heebygeeby on November 28th, 2006

    heebygeeby

    You wouldn't use JSP/Servlets. You would use JavaScript.

    No comments. Post one | Permalink

  • by tigueron on November 27th, 2006

    tigueron

    No comments. Post one | Permalink

Want to attach an image to your answer? Click here.

Did this answer your question? If not, then ask a new question or create a poll.

You're reading Using JSP/Servlet, how can I disable the BACK button of a user's browser?

Follow us on Facebook!

Related Ads

ANSWERBAG BUZZ

How to disable back button in jsp
Disable back button in jsp
How to disable back button of browser
How to disable back button of browser in jsp
Disable browser back button in jsp