  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | JasperException wraps ServletException wraps JspException | JasperException wraps ServletException wraps JspException 2004-09-10 - By Jan Luehe
Back [Resending, since my original posting contained JspServletWrapper.java as an attachment and therefore exceeded the maximum message size of 300 lines enforced by the JSP-INTEREST list.]
Hi Paul,
> When I throw a JspException from a custom tag the PageContext > handlePageException() method wraps it in a ServletException
unless the JspException contains a root cause, in which case its root cause it wrapped inside the ServletException.
> and then Tomcat JspServletWrapper.service() wraps that in a JasperException > (which is also a ServletException). So the original exception is 3 deep > and the stack trace of the original exception is not reported in the log > (and if there is no message, as with a NullPointerException, then there > is not even a message about what happened). So there is little or no > useful diagnostics. What is the rationale for this behavior? It seems > like the service() method should not wrap a ServletException inside a > JasperException.
Which version of the sources did you look at?
The Tomcat 5 version of JspServletWrapper.service() has this code at the bottom:
} catch (ServletException ex) { throw ex; } catch (IOException ex) { throw ex; } catch (IllegalStateException ex) { throw ex; } catch (Exception ex) { throw new JasperException(ex); }
which wraps an exception inside a JasperException only if it is neither of type ServletException, IOException, and IllegalStateException.
Jan
=========================================================================== To unsubscribe: mailto listserv@(protected) with body: "signoff JSP-INTEREST". For digest: mailto listserv@(protected) with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
|
|
 |