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!!");
}
%>
When I try to invoke a non-existing page, notFoundError.jsp is invoked, but the
exception is null. I looked up the stack at ApplicationDisptacher.forward, and
the request attributes are as follows:
[null, null, javax.servlet.error.message=/testing/nonExistantPage.jsp, null,
null, null, null, javax.servlet.error.status_code=404,
javax.servlet.error.servlet_name=jsp, null, null, null,
javax.servlet.error.request_uri=/testing/nonExistantPage.jsp, null, null, null]
As you can see the exception is null…
What am I doing wrong?
Thanks,
Nadav