You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Upham <ju...@more.net> on 2001/05/14 20:33:27 UTC
Re: Additional Question about web app ; Is it possible to
set the GLOBAL default error page forTomCat 4?]
Tomcat gurus:
I still have not had a response to my original question of 05/09/01 about DEFAULT TC4 error return page, but while looking further into the use of web application <error-page> directives in the app's web.xml, I have come across the
following problem:
1) Using a JSP page to set a parameter via form with same page as action, perform a divide of 17 by the parameter value. When I enter 0 for the parameter, the expected javax.servlet.ServletException / by 0 is triggered, with root cause of
java.lang.ArithmeticException / by 0. However, I have placed into the web.xml the following:
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>customerrorSE.html</location>
</error-page>
(I have also tried permutations of the <location> value, with no avail. The html file is in the webapps root directory.)
Adding a directive for the Arithmetic exception:
<error-page>
<exception-type>java.lang.ArithmeticException</exception-type>
<location>customerrorJE.html</location>
</error-page>
also has no effect.
So, does anyone know why this does not appear to be working?
-------- Original Message --------
Subject: Is it possible to set the GLOBAL default error page for Tomcat 4?
Date: Wed, 09 May 2001 17:34:03 -0500
From: John Upham <ju...@more.net>
Organization: MOREnet Systems & Programming
To: tomcat-user@jakarta.apache.org
BCC: jupham@voyager.apg.more.net, jupham@more.net
I understand the use of the error-page directive in an application
web.xml, but we are interested in changing the default error-page
returned globally by Tomcat 4.
We would like to return a "user-friendly" error response with a
customized error page that does not include the stack trace info
(but from which we can do informational logging).
Is it possible to declare a default error-page value in the Tomcat
server.xml (or other config file)? Barring that, is it possible to
create a custom error handler class to override the Tomcat error
handler?
Thanks for any help,
jbu
--
John B. Upham Systems & Programming -- Web Application Programmer
MOREnet 573-884-7200 3212 LeMone Industrial
Blvd.
jupham@more.net 573-882-4624 Columbia MO 65201