You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Armand Larregoity <A....@citb.bull.net> on 2003/03/05 16:42:35 UTC

Tomcat ignores the configuration

    Hello,

    I'm using Tomcat 4.1.12.
    I'm trying to configure an error-page in the web.xml file  :

<web-app>
    ...
  <error-page>
     <exception-type>java.lang.Throwable</exception-type>
     <location> /jsp/error.jsp </location>
   </error-page>
    ...
</web-app>

    but when an exception occurs, the request isn't forwarded to
error.jsp. I simply get  a "org.apache.jasper.JasperException" in the
catalina.out file.
    When I put a         'errorPage="/jsp/error.jsp"' directive in my
jsp pages, it works ...

    Is the problem known ? Is there a problem in my web.xml file ?

Armand


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


Re: Tomcat ignores the configuration

Posted by Rosdi bin Kasim <ro...@epantai.com.my>.
Now I remember one thing.. the order of tag is important.. ie <taglib>
cannot precede <error-page>  etc.. etc..

Here is a sample of mine, which I got it working.. note that I put <taglib>
last. Had I put it at the top, Tomcat will throw some exception..

Probably you can do some googleing on this...

---------------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

  <error-page>
     <exception-type>java.lang.Throwable</exception-type>
     <location>/error/exception.jsp</location>
  </error-page>

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

  <error-page>
    <error-code>500</error-code>
    <location>/error/500.jsp</location>
  </error-page>

 <taglib>
  <taglib-uri>http://jakarta.apache.org/taglibs/session-1.0</taglib-uri>
   <taglib-location>/WEB-INF/session.tld</taglib-location>
 </taglib>

</web-app>

---------------------------------------





----- Original Message -----
From: "Armand Larregoity" <A....@citb.bull.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, March 06, 2003 6:44 PM
Subject: Re: Tomcat ignores the <error-page> configuration


> Rosdi,
>
> Thanks for the tip, but it doesn't work.
>
> Armand
>
> Rosdi bin Kasim a écrit :
>
> > I am guessing here, but try to remove the leading and trailing space.
See if
> > it work.
> >
> > Instead of:
> >
> > <location> /jsp/error.jsp </location>
> >
> > Why not:
> >
> > <location>/jsp/error.jsp</location>
> >
> > Rosdi bin Kasim.
> >
> > ----- Original Message -----
> > From: "Armand Larregoity" <A....@citb.bull.net>
> > To: <to...@jakarta.apache.org>
> > Sent: Wednesday, March 05, 2003 11:42 PM
> > Subject: Tomcat ignores the <error-page> configuration
> >
> > >
> > >     Hello,
> > >
> > >     I'm using Tomcat 4.1.12.
> > >     I'm trying to configure an error-page in the web.xml file  :
> > >
> > > <web-app>
> > >     ...
> > >   <error-page>
> > >      <exception-type>java.lang.Throwable</exception-type>
> > >      <location> /jsp/error.jsp </location>
> > >    </error-page>
> > >     ...
> > > </web-app>
> > >
> > >     but when an exception occurs, the request isn't forwarded to
> > > error.jsp. I simply get  a "org.apache.jasper.JasperException" in the
> > > catalina.out file.
> > >     When I put a         'errorPage="/jsp/error.jsp"' directive in my
> > > jsp pages, it works ...
> > >
> > >     Is the problem known ? Is there a problem in my web.xml file ?
> > >
> > > Armand
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


RE : Tomcat ignores the configuration

Posted by sylvain fernandes <sy...@orange.fr>.
I try to make a error redirection and it doesn t work if you have the
solution to configure serveur.xml (tomcat 4.1.18) can you help me
Thank's


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


Re: Tomcat ignores the configuration

Posted by Armand Larregoity <A....@citb.bull.net>.
Rosdi,

Thanks for the tip, but it doesn't work.

Armand

Rosdi bin Kasim a écrit :

> I am guessing here, but try to remove the leading and trailing space. See if
> it work.
>
> Instead of:
>
> <location> /jsp/error.jsp </location>
>
> Why not:
>
> <location>/jsp/error.jsp</location>
>
> Rosdi bin Kasim.
>
> ----- Original Message -----
> From: "Armand Larregoity" <A....@citb.bull.net>
> To: <to...@jakarta.apache.org>
> Sent: Wednesday, March 05, 2003 11:42 PM
> Subject: Tomcat ignores the <error-page> configuration
>
> >
> >     Hello,
> >
> >     I'm using Tomcat 4.1.12.
> >     I'm trying to configure an error-page in the web.xml file  :
> >
> > <web-app>
> >     ...
> >   <error-page>
> >      <exception-type>java.lang.Throwable</exception-type>
> >      <location> /jsp/error.jsp </location>
> >    </error-page>
> >     ...
> > </web-app>
> >
> >     but when an exception occurs, the request isn't forwarded to
> > error.jsp. I simply get  a "org.apache.jasper.JasperException" in the
> > catalina.out file.
> >     When I put a         'errorPage="/jsp/error.jsp"' directive in my
> > jsp pages, it works ...
> >
> >     Is the problem known ? Is there a problem in my web.xml file ?
> >
> > Armand
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


Re: Tomcat ignores the configuration

Posted by Rosdi bin Kasim <ro...@epantai.com.my>.
I am guessing here, but try to remove the leading and trailing space. See if
it work.

Instead of:

<location> /jsp/error.jsp </location>

Why not:

<location>/jsp/error.jsp</location>


Rosdi bin Kasim.


----- Original Message -----
From: "Armand Larregoity" <A....@citb.bull.net>
To: <to...@jakarta.apache.org>
Sent: Wednesday, March 05, 2003 11:42 PM
Subject: Tomcat ignores the <error-page> configuration


>
>     Hello,
>
>     I'm using Tomcat 4.1.12.
>     I'm trying to configure an error-page in the web.xml file  :
>
> <web-app>
>     ...
>   <error-page>
>      <exception-type>java.lang.Throwable</exception-type>
>      <location> /jsp/error.jsp </location>
>    </error-page>
>     ...
> </web-app>
>
>     but when an exception occurs, the request isn't forwarded to
> error.jsp. I simply get  a "org.apache.jasper.JasperException" in the
> catalina.out file.
>     When I put a         'errorPage="/jsp/error.jsp"' directive in my
> jsp pages, it works ...
>
>     Is the problem known ? Is there a problem in my web.xml file ?
>
> Armand
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Re: Tomcat ignores the configuration

Posted by Daniel Williams <dw...@datainventory.com>.
I have the some problem, but I'm trying to handle 404 and 500 errors.

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

           
            <error-page>
                    <error-code>500</error-code>
                    <location>/error/tomcat500.jsp</location>
            </error-page>
The 404 works but 500s do not. Is a exception under Tomcat consider a 
error 500?



Armand Larregoity wrote:

>    Hello,
>
>    I'm using Tomcat 4.1.12.
>    I'm trying to configure an error-page in the web.xml file  :
>
><web-app>
>    ...
>  <error-page>
>     <exception-type>java.lang.Throwable</exception-type>
>     <location> /jsp/error.jsp </location>
>   </error-page>
>    ...
></web-app>
>
>    but when an exception occurs, the request isn't forwarded to
>error.jsp. I simply get  a "org.apache.jasper.JasperException" in the
>catalina.out file.
>    When I put a         'errorPage="/jsp/error.jsp"' directive in my
>jsp pages, it works ...
>
>    Is the problem known ? Is there a problem in my web.xml file ?
>
>Armand
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>  
>



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