[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 [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL 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

Reply via email to