________________________________
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