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 Tue, 06 Feb 2001 00:55:35 GMT
cmanolache@yahoo.com wrote:

> > > > 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.
>
> ???
>
> Section 8.5 in 2.3 PFD says:
> "Only runtime exceptions and checked exceptions of type ServletException
> and IOException should be propagated ... if thrown by the target of
> RequestDispatcher. All other exceptions should be wrapped ... "
>
> My understanding of this is that NullPointerException should be
> propagated, not wrapped, same for security and any other RuntimeException.
>

Mea culpa.  Costin's interpretation is correct (I was too focused on the "checked
exceptions" part of the statement quoted above), and Tomcat 4 is currently broken in
this respect.  That will get changed tonight.


>
> Costin
>

Craig



Mime
View raw message