struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronny Løvtangen (JIRA) <j...@apache.org>
Subject [jira] Commented: (WW-2869) Actions invoked with <s:action..> gets actionErrors copied from main action
Date Fri, 19 Mar 2010 23:10:27 GMT

    [ https://issues.apache.org/jira/browse/WW-2869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847640#action_12847640
] 

Ronny Løvtangen commented on WW-2869:
-------------------------------------

Nice, thanks! Haven't tried the patch yet, unfortunately it could take a while since I'm on
vacation until 6th of April. Will try the patch then.

> Actions invoked with <s:action..> gets actionErrors copied from main action
> ---------------------------------------------------------------------------
>
>                 Key: WW-2869
>                 URL: https://issues.apache.org/jira/browse/WW-2869
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.0.13, 2.1.2
>            Reporter: Ronny Løvtangen
>            Assignee: Lukasz Lenart
>         Attachments: test.zip, WW-2869.patch
>
>
> If I invoke an action from a JSP with <s:action..>, that action will get actionErrors
copied from the first action.
> This is done by ChainingInterceptor, unless the first action implements Unchainable.
> Actions included with <s:action..> should be independent of the page they are included
from, this is not the same as using resultType 'chain'.
> Example:
> FooAction:
> public class FooAction extends ActionSupport {
>   public String execute() {
>         addActionError("an error from FooAction");
>         return SUCCESS;
>   }
> }
> foo.jsp:
> <s:action name="bar"/>
> BarAction:
> public class BarAction extends ActionSupport{    
> }
> struts.xml:
> <action name="foo" class="test.FooAction">
> 	<result>/jsp/foo.jsp</result>
> </action>
> <action name="bar" class="test.BarAction">
> 	<result>/jsp/bar.jsp</result>
> </action>
> When going to /foo.action then BarAction is never invoked because:
> 1) FooAction adds actionError
> 2) foo.jsp is displayed
> 3) foo.jsp invokes BarAction with <s:action..> tag
> 4) ChainingInterceptor intercepts BarAction and copies actionErrors from FooAction to
BarAction
> 5) DefaultWorkflowInterceptor intercepts BarAction and since BarAction now has actionErrors,
it stops the invocation and returns "input"
> 6) There is no "input" result defined for BarAction, which leads to Exception
> This is the line in ChainingInterceptor that copies the actionErrors:
> reflectionProvider.copy(o, invocation.getAction(), ctxMap, excludes, includes);
> This shouldn't be done in the case of a <s:action..>, only for resultType 'chain'
> I have verified that this is still an issue in the latest svn version of 2.1.3 (rev 701674).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message