You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Paul Benedict (JIRA)" <ji...@apache.org> on 2006/11/26 07:05:57 UTC

[jira] Updated: (STR-2437) Standardize JspException/ServletException Re-Throws To Contain Root Cause

     [ http://issues.apache.org/struts/browse/STR-2437?page=all ]

Paul Benedict updated STR-2437:
-------------------------------

    Bugzilla Id:   (was: 34604)
    Component/s: Taglibs
                     (was: Unknown)
       Assignee:     (was: Struts Developers)

> Standardize JspException/ServletException Re-Throws To Contain Root Cause
> -------------------------------------------------------------------------
>
>                 Key: STR-2437
>                 URL: http://issues.apache.org/struts/browse/STR-2437
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Taglibs
>    Affects Versions: 1.2.4
>         Environment: Operating System: All
> Platform: All
>            Reporter: Lukas Bradley
>            Priority: Minor
>
> It would be exceptionally helpful if the Struts project were to standardize
> throughout development that all caught exceptions that are to be re-thrown
> should contain the root cause unless a clearly stated, specific reason exists to
> not do so.
> For example, in org.apache.struts.taglib.tiles.InsertTag on any Exception within
> doEngTag(), the following occurs:
> catch (ServletException e) {
>   Throwable cause = e;
>   if (e.getRootCause() != null) {
>      cause = e.getRootCause();
>   }
>   String msg = "ServletException in '" + page + "': " + cause.getMessage();
>   log.error(msg, e);
>   throw new JspException(msg);
> }
> It would be rather simple to do the following for the last line:
>   throw new JspException(msg, e);
> While the root exception message is logged, this information is not available to
> an upper-level application layer.  For example, if a custom SecurityException is
> thrown on a JSP or Tag, important information may be lost in the propogation of
> this exception.
> I have looked within the 1.2.6 beta codebase (as of today, 25 April 2005) and
> the approach remains the same.
> Note: I did not choose the "Tiles Framework" for this report's Component
> purposefully.  In my opinion, it should be a standard coding procedure across
> Struts, and possibly other Jakarta projects.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira