tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: RequestDispatcher and exceptions
Date Mon, 05 Feb 2001 22:42:25 GMT
cmanolache@yahoo.com wrote:

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

Just the spec requirement (Section 8.5 for 2.3 PFD; I'm sure the 2.2 spec had a
similar statement.

>
> ( 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).
>
> Costin
>

Craig



Mime
View raw message