Hi Bob, 
Thanks for the quick reply. Is there anywhere where I can find documentation 
for this? I'm asking because I came across this behavior by chance when I got a 
NullPointerException in logging code calling exception.getMessage().
Is it possible that I will come across this with other types of exceptions? Is 
my logging code unusable?
Thanks,
Nadav
-----Original Message-----
From: Bob Hall [mailto:rfha...@yahoo.com] 
Sent: Sunday, September 11, 2011 12:54 PM
To: Tomcat Users List
Subject: Re: JSP Exception object arriving null at error handler





________________________________
From: Nadav Katz <nadav.k...@oracle.com>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Sunday, September 11, 2011 2:11 AM
Subject: JSP Exception object arriving null at error handler

Hi,

I seem to be having a problem with the exception object attribute arriving null 
at the error handeling jsp. 

Since I encountered this error in production, I recreated on a small project.

This is the web.xml error page entry: 

<error-page>

                                <error-code>404</error-code>

                                <location>/notFoundErrorPage.jsp</location>

</error-page>

 

This is notFoundError.jsp:

<%@ page isErrorPage="true" %>

<%@ page isELIgnored="false"%>

 

<%

        if(exception != null)

        {

                System.out.println("Exception is not Null, it's " + 
exception.toString());

        }

                  else

                  {

                                System.out.println("Exception is Null!!");

                  }

%>

What am I doing wrong? 

====

Nadav,

There is no Exception in this case.

This example should work for you _and_ allow you to display the resource that 
was not found:

http://stackoverflow.com/questions/4948275/get-url-of-page-requested-that-caused-a-404

- Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to