You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Carlos Pita <cp...@tycdigital.com> on 2001/04/06 19:44:19 UTC

Redirecting 404,500, etc.

Hi!
    I have a simple question: is there a configuration directive that says
Tomcat to redirect 404, 500, etc error codes to a customized output page
(like the Apache's ErrorDocument directive). I'm using Tomcat 3.2.1 with
Apache 1.3.12, and although I could sucesfully configure Apache to do this,
requests which pass through to Tomcat don't have the desired behaviour.

Thank you in advance,
    Carlos



Re: Redirecting 404,500, etc.

Posted by Stéphane BAUDET <sb...@gltrade.fr>.
Hello,

In your web.xml, you should add the <error-page> tag.
For example:

<error-page>
 <error-code>404<error-code/>
 <location>/404.html<location/>
</error-page>

This is well explain in the Java Servlet Specification , in the
Deployment desciptor section.
(see www.javasoft.com)


Carlos Pita a écrit :
> 
> Hi!
>     I have a simple question: is there a configuration directive that says
> Tomcat to redirect 404, 500, etc error codes to a customized output page
> (like the Apache's ErrorDocument directive). I'm using Tomcat 3.2.1 with
> Apache 1.3.12, and although I could sucesfully configure Apache to do this,
> requests which pass through to Tomcat don't have the desired behaviour.
> 
> Thank you in advance,
>     Carlos

-- 
Cordialement,


Stéphane BAUDET

_________________________________________________________
GL Trade
48, rue Notre Dame des Victoires - 75002 Paris
Tel : 01 53 40 43 12 (interne 1312)
Fax : 01 53 40 01 40
Email : sbaudet@gltrade.fr
_________________________________________________________