You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Gunther Schadow <gu...@aurora.rg.iupui.edu> on 2000/02/11 03:28:16 UTC

Fixed source code (was: Re: Bug in error page handling?)

All right I changed the sources so that they comply with the 
spec. Now the error page traps all Throwables.  Attached are
the three source files I had to change. The changes are minor
and are attached as one context diff file with three chunks.
Someone please review the implication and insert this into the
source tree.

thanks,
-Gunther

Gunther Schadow wrote:
> 
> If I could add something, did a little more research, found that
> the below-mentioned edit had been made from revision 1.1 to 1.2
> (very early) and this is a dependence to the javax.jsp.PageContext
> class.  That means that a lot of change is needed upstream to
> make the PageContext.handlePageException(Exception ex) into a
> handlePageException(Throwable ex).  Anyway, I think it is well
> worth the effort, since you really don't want to have Errors
> unhandled or dumped to the System.err.
> 
> Can someone fix this? If I did, I'd change javax.jsp.PageContext
> but I'm not sure whether changing this interface is allowed? The
> change would be backwards compatible since an Exception is a
> Throwable. But I guess I still don't want to get involved.
> 
> -Gunther
> 
> I wrote:
> > Hi,
> >
> > in jakarta-tomcat v3.0
> >
> > the errorPage directive does not comply to its specification.  The
> > spec says that the error page will catch the most general exception,
> > the "Throwable", when in fact it only handles regular "Exceptions"!
> > This is most unfortunate since you wannabe able to catch all those
> > Errors too that you throw while developing.
> >
> > I hunted after this bug in the source code and found:
> >
> > org.apache.jasper.compiler.JspParserEventListener.generateFooter()
> >
> > where the following two lines made me think:
> >
> >   //writer.println("} catch (Throwable t) {");
> >   writer.println("} catch (Exception ex) {");
> >
> > this means someone has deliberately violated the spec and did so
> > temporarily with the intention to solve a problem and then come
> > back bring everything into conformance again. However, this person
> > may have got distracted.
> >
> > Does someone take care about it or should I hack on this? I really
> > didn't want to get involved in yet another meta-software development
> > project. Gee, I'll give it one shot.
> >
> > regards
> > -Gunther
> 
>   --------------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org