Hi,
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:
[EMAIL PROTECTED] isErrorPage=true %
%@ taglib uri=/WEB-INF/custom.tld prefix=custom %
%
System.out.println(Exception = + exception);
System.out.println(exPage = + pageContext.getException());
%
HTML
HEAD
titleError/title
/HEAD
body
H1Error occured/H1
custom:errortag/
/body
/html
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
exception.
exPage = null
pageContext has null exception
As far as I know, for all error pages ([EMAIL PROTECTED] isErrorPage=true
%),
the counterpart for the implicit variable 'exception' of a JSP is
pageContext.getException().
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,
Konrad
--
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden testen ++ http://www.gmx.net/de/go/promail ++
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]