1 Reply Latest reply on Feb 10, 2005 9:04 AM by Dan Thompson

    Basic Auth Failure - Custom Error Page

    sj_bennett Newbie

      Does anyone know what I need to do to display a custom error page if the user selects "Cancel" or login fails 3 times. I would rather display something besides

      HTTP Status 401 -

      type Status report

      message

      description This request requires HTTP authentication ().
      Apache Tomcat/5.0.28


      Thanks,
      steve

        • 1. Re: Basic Auth Failure - Custom Error Page
          Dan Thompson Newbie

          Yes, in your web.xml you need to define an error page.... look at the web.xml spec... but basically something like this
          <error-page>
          <error-code>404</error-code>
          /error-pages/404.jsp
          </error-page>
          which should come just after your welcome page declarations if I am not mistaken.. but again... read the spec.

          Then you need to look at the jsp error page spec, because generally you want the<%@ page isErrorPage="true" %> tag in there. This gives you access to all the error information.

          Now THE TRICK that nobody tells you... IE will throw away any error page that is smaller than some magic number. So I always pad my error pages with a couple kbytes of spaces.