DynamicMappingFilter fails with FileNotFoundException when <jsp:include> is 
used to include an action
-----------------------------------------------------------------------------------------------------

                 Key: STS-715
                 URL: http://www.stripesframework.org/jira/browse/STS-715
             Project: Stripes
          Issue Type: Bug
          Components: ActionBean Dispatching
    Affects Versions: Release 1.5.1
         Environment: Probably the bug is platform independent, but it might be 
Glassfish-specific, I don't have resources to test it in other app servers
            Reporter: Grzegorz Krugły


Using code like

    <s:url var="url" beanclass="package.MyAction" prependContext="false"/>
    <jsp:include page="${url}"/>

when DynamicMappingFilter is used instead of ServletDispatcher, results in 
FileNotFoundException being thrown.

It is because ErrorTrappingResponseWrapper, as documented in line 343 comment 
"// Wrap the response in a wrapper that catches errors (but not exceptions)", 
does NOT catch any exceptions. When jsp:include is used to include an action 
URL instead a JSP file, the include request goes down to the default servlet 
which doesn't return SC_NOT_FOUND error code but throws a FileNotFoundException.

I have worked around the issue by changing

    chain.doFilter(request, wrapper);

in DynamicMappingFilter.doFilter() method to

        try {
            chain.doFilter(request, wrapper);
        } catch (FileNotFoundException fnfex) {
            fnfthrown = true;
        }

and manually overriding wrapper's errorCode to SC_NOT_FOUND in case the above 
exception is caught. I do not post entire patch because it's ugly and am hoping 
someone more knowledgeable with Stripes will be able to fix it better.


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

       

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to