tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff_Mycha...@nlgroup.ca
Subject RE: error page for error code 500?
Date Tue, 04 Feb 2003 15:54:23 GMT

Thank you for the reply.

I should be clearer. We are developing a struts app and I am using tiles
and declarative error handling features.
My goal is to have the user only my error pages (not server errors ect.)
I know that certain errors  fall outside of the struts controller.

Over the course of development, I have triggered the odd 404,400, and 500
tomcat error page.
In web.xml i was able to map 404 and 400 but not 500.

I can simulate each error:
404 - calling a non existent page
400 - calling a non existent action mapping
500 - calling without a web app context: ie /action.do instead of
/myApp/action.do    (I'm sure there are other ways..)

The reason I posted to this list is that I am under the understanding that
I could map any error code to a page.

Am I wrong?
<!-- This works...-->
  <error-page>
    <error-code>404</error-code>
    <location>/error/ServerError404Page.jsp</location>
  </error-page>

  <error-page>
    <error-code>400</error-code>
    <location>/error/Server400ErrorPage.jsp</location>
  </error-page>

  <!-- this does not work - why?  -->
  <error-page>
    <error-code>500</error-code>
    <location>/error/Server500ErrorPage.jsp</location>
  </error-page>

  Thanks for the help..





"Craig R. McClanahan" <craigmcc@apache.org> on 02/03/2003 10:01:07 PM

Please respond to "Tomcat Users List" <tomcat-user@jakarta.apache.org>

To:    Tomcat Users List <tomcat-user@jakarta.apache.org>
cc:

Subject:    RE: error page for error code 500?




On Tue, 4 Feb 2003, Chong, Kwong wrote:

> Date: Tue, 4 Feb 2003 09:04:42 +1100
> From: "Chong, Kwong" <Kwong.Chong@sensis.com.au>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: 'Tomcat Users List' <tomcat-user@jakarta.apache.org>
> Subject: RE: error page for error code 500?
>
>
> Doesn't error 500 means the server (tomcat) isn't responding?
> in which case, if there's a problem with tomcat, it can't then process
the
> request to tell you there's a problem ;)
>

By far the most common cause is that Tomcat is running fine, but your
servlet or JSP page threw an exception.  The only way to know for sure is
to examine the exception traceback that is presented in the response
and/or in the log files created by Tomcat in the $CATALINA_HOME/logs
directory.

Just for fun, run the following JSP page and see what you get:

  <%
    int i = 5;
    int j = 0;
    int k = i / j;
  %>

and examine the stack trace that shows up (a divide by zero error).
That's an application programming error, and nothing to do with the
container.

Craig

---------------------------------------------------------------------
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


Mime
View raw message