tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Bernstein" <>
Subject pageContext.getException() always null
Date Mon, 06 Jun 2005 06:41:08 GMT
I have a rather strange problem with handling an exception within a custom
jsp tag.

The problem is, that pageContext.getException() always returns null.
This is the case within the tag's code, but also witin a Scriptlet within
the JSP.
However, the variable 'exception' itself is properly set.

My error.jsp looks like this:
<%@page isErrorPage="true" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

   System.out.println("Exception = " + exception);
   System.out.println("exPage = " + pageContext.getException());
   <H1>Error occured</H1>

The tag class has code like this:

    private Exception getTerribleException() {
        if (pageContext.getException() == null) {
            System.out.println("pageContext has null exception");
            return null;

Well, the output is as mentioned above: only the variable 'exception' within
the JSP can be successfully accessed. Retrieving the exception from the
pageContext always returns null.

Exception = javax.servlet.ServletException: This is my self thrown
exPage = null
pageContext has null exception

As far as I know, for all error pages (<%@page isErrorPage="true" %>),
the counterpart for the implicit variable 'exception' of a JSP is

However, something seems to go wrong.
I'm using JBoss 3.2.26 with integrated Tomcat. I also tried tomcat
standalone (5.0.18), same result.

Help greatly appreciated,

Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden & testen ++ ++

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message