On Mon, 19 Mar 2001, Samuel Arnod-Prin wrote:

> How to set this handler ?
> I don't find how.
> 
> I've looked in tomcat's code, and when there is an exception it seems
> there are attributes in the request that gives for examples the
> Throwable object.
> 
> thanx for helping
> 
> 

Check out the information about the <error-page> element in the deployment
descriptor.  Among other places, you can read about it in the Servlet
Specification, version 2.2, at:

        http://java.sun.com/products/servlet/download.html

For example, you can define your own handler for 404 errors (resource not
found):

        <error-page>
                <error-code>404</error-code>
                <location>/my404page.jsp</location>
        </error-page>

NOTE:  If you are running behind Apache, this will work only if the
request actually got forwarded to Tomcat (which is not the default for
static resources).  If it did not get forwarded, the standard Apache
mechanisms are used.

Craig McClanahan


Reply via email to