You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brett Porter <bp...@f2network.com.au> on 2001/10/26 09:26:43 UTC

TC4.0.1 - 500 error-page not working

Hi,

I've implemented a JSP page for handling 500 errors, but its not 
working. A similar page works fine for 404 errors coming from Tomcat. 
The error in question is a NullPointerException, but this shouldn't matter.

 From web.xml:
  <error-page>
    <error-code>500</error-code>
    <location>/system/error_docs/server.jsp</location>
  </error-page>
  <error-page>
    <error-code>404</error-code>
    <location>/system/error_docs/filenotfound.jsp</location>
  </error-page>

The jsp's use templates. Is it just the case 500's don't work with JSP's?

Searching the mail archive for a similar topic only revealed information 
about how to do it from the servlet spec., which is what I used to 
achieve this.

Thanks,
Brett



Re: TC4.0.1 - 500 error-page not working

Posted by Remy Maucherat <rm...@home.com>.
> Hi,
>
> I've implemented a JSP page for handling 500 errors, but its not
> working. A similar page works fine for 404 errors coming from Tomcat.
> The error in question is a NullPointerException, but this shouldn't
matter.
>
>  From web.xml:
>   <error-page>
>     <error-code>500</error-code>
>     <location>/system/error_docs/server.jsp</location>
>   </error-page>
>   <error-page>
>     <error-code>404</error-code>
>     <location>/system/error_docs/filenotfound.jsp</location>
>   </error-page>
>
> The jsp's use templates. Is it just the case 500's don't work with JSP's?
>
> Searching the mail archive for a similar topic only revealed information
> about how to do it from the servlet spec., which is what I used to
> achieve this.

The tester sets some error pages for some exception types (like the AOOB
exception), and it works ok. Note that if the response is already committed
(flushing the response buffer will commit the response), it won't work.

In general, if you see the fancy error report, you should be able to use an
error page.

Remy