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 2004/10/12 04:43:20 UTC

DO NOT REPLY [Bug 31659] New: - Page context not fully populated for Exception if using app-wide error page

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=31659

Page context not fully populated for Exception if using app-wide error page

           Summary: Page context not fully populated for Exception if using
                    app-wide error page
           Product: Tomcat 5
           Version: 5.0.28
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: roger42yates@yahoo.co.uk


No exception is displayed when using the EL expression 
${pageContext.exception} on an application-wide error page. (If using a page-
specific error page, the details are displayed correctly - even using a copy 
of the same page!).

EL *is* being evaluated since it is possible to display the exception by using 
the following EL expression: ${pageContext.errorData.throwable}

Here's what I'm using:
In the DD:
	<error-page>
		<exception-type>java.lang.NullPointerException</exception-type>
		<location>/nullErrorPage.jsp</location>
	</error-page>

The error page nullErrorPage.jsp:
<%@ page isErrorPage="true"%>
<html><body>
You caused a NULL pointer exception! :( <br>
Exception type: ${pageContext.exception} <br>
Errordata: ${pageContext.errorData.throwable} <br>
</body></html>

and the request page:
<html><body>
Trying something naughty...: <br>
<% String s=null ; %>
<% int x=s.length() ; %>
</body></html>

By adding the line: <%@ page errorPage="/nullErrorPage.jsp" %>
to the request page, the exception details will be displayed correctly, so 
something is happening (or rather not happening) for a DD-specified error page.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org