tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RequestDispatcher and exceptions
Date Mon, 05 Feb 2001 20:38:02 GMT

I'm working on few bugs related with RequestDispatcher ( well, it started
with parameter handling, but RequestDispatcher is the place that have to
be resolved first in order to resolve parameters - since it is doing
special things with the params ).

The main issue is what should happen if an exception is thrown in
include() ?

The current behavior is that the error handler is called, and it displays
the "500 whatever" or the error page for that exception.

But by reading the spec, it seems that the "correct" thing to do is to 
just throw the exception - 
include() does have a throw declaration and is documented to throw

My understanding is that "error handlers" ( as declared in server.xml or
the implicit ones ) should be called only on the top-level request.
( a servlet including another one may be able to deal with the errors - if
it doesn't catch them they will be thrown anyway )..

The particular test is /test/servlet/dispatch.PrintWriterTest1Servlet
where it expects the error in include to be reported instead of thrown.

My preference would be to fix the test and throw exceptions from
include(). On the other side this changes the behavior of tomcat - and I
need a second opinion. If indeed the include() is supposed to throw the
exception, then it's a spec issue and the previous behavior doesn't


View raw message