tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmanola...@yahoo.com
Subject Re: RequestDispatcher and exceptions
Date Mon, 05 Feb 2001 23:13:20 GMT
> > > 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.

Costin






Mime
View raw message