You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kevin Ritter <ke...@jcafeinc.com> on 2003/06/13 16:15:03 UTC

Customizing 401 Error Page (this should be easy)

I have spent roughly a day going through the Tomcat archives looking for a
solution to customizing an error page instead of displaying the default 401
or for that matter 403, or 404, or 500 error pages. I have modified my
web.xml file to contain the following: 

  <error-page> 
    <error-code>401</error-code> 
    <location>/jcafe-error.jsp</location> 
  </error-page> 

I'm not getting any errors that would prevent Tomcat from starting. 

I've placed the jcafe-error.jsp (JSP containing the custom error 401 error
message) in the same directory that my index.jsp file resides in, which
kicks off the basic authentication; however, when I access my application
(e.g., index.jsp), I get the error page described in the jcafe-error.jsp
instead of the basic authentication login dialog. I've read some archive
traffic regarding this phenomena, but evidently it was a problem in Tomcat
4.0.1 and 4.0.2. I'm using Tomcat 4.0.3. So my question is this still a
problem (not supported due to bugs in 4.0.3) or am I doing something wrong.
Something that seems to be so easy turns out to be so hard so I'm assuming
I'm missing this up. Please help. 

Thank you in advance on the behalf of my manager who requested this silly
feature believing web users are all hopelessly lost and in need of
grammatically correct and informational error messages. 

With kind regards, 
Kevin Ritter

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org