[ 
https://issues.apache.org/jira/browse/WW-2869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart resolved WW-2869.
-------------------------------

    Fix Version/s: 2.2.0
       Resolution: Fixed

Solved, thanks!

> 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
>             Fix For: 2.2.0
>
>         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.

Reply via email to