cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: [C1] Get TomCat to handle Errors & Exceptions?
Date Mon, 26 Mar 2001 16:54:29 GMT
Jeremy Quinn <jermq@media.demon.co.uk> wrote:
>Reading the Servlet 2.2 spec, it appears that it should be possible to map
>HTTP error-codes and Java Exceptions to specific pages, in my context's
>web.xml.
>
>I have been trying to set this up, with no success.
>
>1. Turn off internal error handling in cocoon.properties
>
>		handle.errors.internally = false
>
>2. Add error handlers in web.xml
>
>		<error-page>
>			<error-code>500</error-code>
>			<location>error500.html</location>
>		</error-page>
>
>		<error-page>
>			<exception-type>java.lang.NullPointerException</exception-type>
>			<location>errorNPE.html</location>
>		</error-page>

This could be the problem:
src/org/apache/cocoon/Cocoon.java


                } catch (Throwable t) {
                    if (errorsInternally) {
                        Frontend.error(response, "Error found handling the 
request.", t);
                    } else {
                        response.sendError(500, 
Utils.getStackTraceAsString(t));
                    }
                }

Try changing the last statement to throw new ServletException (t);

I should probably change this (and the other one in the same method) in CVS, 
right?



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message