You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/06/20 00:28:17 UTC

DO NOT REPLY [Bug 9980] - exception object is null inside an error page (given certain conditions)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9980>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9980

exception object is null inside an error page (given certain conditions)

steve5m@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Normal                      |Minor
             Status|RESOLVED                    |REOPENED
           Priority|Other                       |Low
         Resolution|WORKSFORME                  |
            Summary|exception object is null    |exception object is null
                   |inside an error page        |inside an error page (given
                   |                            |certain conditions)



------- Additional Comments From steve5m@yahoo.com  2002-06-19 22:28 -------
Did some more testing to identify more specific case that this bug happens:
First, let me explain in general terms:
The bug only happens when an exception is thrown
from a full Servlet (not a JSP).
In this case, in the custom defined JSP error page (assume there is one)
the implicit variable called 'exception'
(see p39 and p51 of JSP 1.2 specification) is null.
It should be the same thing as request.getAttribute("javax.servlet.error.exception")
but it is not -- the obvious workaround is to check for null in the error
page and then use the attribute if the variable is null, nevertheless, this
is still a bug.

If you want to look at code, I have attached a war file.
Once you start Tomcat with this war in place, go to
http://<host>:<port>/test_app/servlet/time?crash=true
This servlet, when given that query string, will throw an exception,
which because of the web.xml file is handled by the error_very_simple.jsp
page. Note the page checks for the 'exception' object being null
and prints out a message when it is.
Note also, if you go to the /test_app/throw_exception.jsp page,
this problem does not occur (only occurs when source of exception is a servlet).
Thanks for your time!

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>