tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nadav Katz <nadav.k...@oracle.com>
Subject JSP Exception object arriving null at error handler
Date Sun, 11 Sep 2011 09:11:18 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message