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.
If you want this addressed in the near future, please submit a proposed patch.
Created attachment 13843 [details] Patch against -r1.62
Patch with extended PageContextImpl.getException() to look also for "javax.servlet.error.exception".
Created attachment 14363 [details] Alternative patch Alternative patch used to fix the issue. This patch leverages JspRuntimeLibrary.getThrowable(), which already checks for "javax.servlet.error.exception" and "javax.servlet.jsp.jspException", in this order.