tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nadav Katz <>
Subject RE: JSP Exception object arriving null at error handler
Date Mon, 12 Sep 2011 06:07:40 GMT
Hello Chuck, thanks for your answer.
I have read the servlet spec, I don't remember coming across anything other than SRV 9.9 which
relates, please direct me where to look if I'm wrong.
Also, I don't think I agree with you, for three reasons:
1. If I insert code in my jsp accessing a javascript file (for instance), but get the path
wrong, don't you think it's an exception in the same way as a FileNotFoundException is an
2.There is no difference from a developers point of view in the handling of 404 errors from
any other types. When I declare an error page and map it to 404 status code, it's the exact
same process as for any other code. There is no specific specification in SRV.9.9 that declares
this type of error as different from the rest, and having generic logging code for all of
them is (IMHO) the most logical conclusion from the information at hand.
3. My NPE wasn't at all trivial. It took me half a day + posting in the Tomcat users mailing
list to find the answer. From looking online, I'm not the first to encounter it, but it appears
like I'm one of the first to actually have it answered. That in itself suggests that the "404
is not an exception" logic is at the very least not ubiquitous, which suggests the need for
at least better documentation
In any case, since I am going to change the code, are there any other types of errors that
are not considered exceptions that I should take into consideration? 

-----Original Message-----
From: Caldarale, Charles R [] 
Sent: Sunday, September 11, 2011 5:26 PM
To: Tomcat Users List
Subject: RE: JSP Exception object arriving null at error handler

> From: Nadav Katz [] 
> Subject: RE: JSP Exception object arriving null at error handler

> Is there anywhere where I can find documentation for this?

Read the servlet spec.

> I'm asking because I came across this behavior by chance when I got 
> a NullPointerException in logging code calling exception.getMessage().

Which means your logging code contains invalid assumptions.

> Is it possible that I will come across this with other types of 
> exceptions?

You're missing the point: a 404 status is *not* an exception.

> Is my logging code unusable?

Not necessarily unusable, but certainly broken.

 - Chuck

for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message