tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: RequestDispatcher and exceptions
Date Mon, 05 Feb 2001 21:25:03 GMT
> > 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
> > matter.
> >
> In Tomcat 4, the following rules are applied:
> * If the included servlet throws ServletException or IOException,
>   propogate it on to the calling servlet (i.e. no error page behavior).
> * If the included servlet throws any other exception (such as
>   NullPointerException), wrap it in a ServletException and propogate
>   that to the calling servlet (i.e. no error page behavior).

Great, I'll do something similar in tomcat3.3. 

My only issue is with the special treatement of RuntimeExceptions - is
there a need to wrap them with ServletException ? I would treat
included servlets in the same way as "normal" servlets ( from error
handling perspective). 

( I'm thinking of Security exceptions - all of them are Runtime, and the
"common" behavior is to catch them if you expect them. )

In any case, this is a minor detail ( compared with the decision to throw
or not).


View raw message