[
https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kedar Choudhary updated WW-1963:
--------------------------------
I guess this is how the action configuration looks like?
=========================
<action name="actionA" class="ActionA">
<interceptor-ref name="store">
<param name="operationMode">STORE</param>
</interceptor-ref>
<interceptor-ref name="defaultStack" />
<result name="success">z.jsp</result>
<result name="input"
type="redirect-action">actionB</result>
</action>
<action name="actionB" class="test.ActionB">
<interceptor-ref name="store">
<param name="operationMode">RETRIEVE</param>
</interceptor-ref>
<interceptor-ref name="defaultStack" />
<result name="success">y.jsp</result>
<result name="input">x.jsp</result>
</action>
</package>
============================
If I have got it right, then I think it is not a bug:
On validation error in actionA, it indeed gets redirected to actionB, but....
While executing actionB, the validation errors stored by actionA are retrieved
from the message store before workflow interceptor.
Workflow interceptor has no way of knowing if these validation errors are from
actionB or have been retrieved from the store.
On presence of validation errors, it simply returns "input" result and hence
the x.jsp is shown.
I guess the way you can make this work is put the store interceptor after the
workflow interceptor, i.e.
<action name="actionB" class="test.ActionB">
<interceptor-ref name="defaultStack" />
<interceptor-ref name="store">
<param name="operationMode">RETRIEVE</param>
</interceptor-ref>
<result name="success">y.jsp</result>
<result name="input">x.jsp</result>
</action>
> Incorrect result used if using message store interceptor, validation, and
> action errors.
> ----------------------------------------------------------------------------------------
>
> Key: WW-1963
> URL: https://issues.apache.org/struts/browse/WW-1963
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.0.6, 2.0.7, 2.0.8, 2.0.9
> Environment: Produced on Windows Vista, Java 1.5.0_11, and Tomcat
> 5.5.23
> Reporter: Al Sutton
> Fix For: 2.1.2
>
>
> Reproduction Example
> -------------------------------
> To reproduce this ActionA and ActionB extend ActionSupport and the message
> store interceptor and the validation interceptor are enabled. ActionA uses
> the STORE mode on the message store interceptor, and ActionB uses the
> RETREIVE mode.
> Actual Behaviour
> -----------------------
> If ActionA calls addActionError and then returns a redirect to ActionB the
> validation interceptor looks for an input result on ActionB and either
> redirects the users to ActionBs input result, or fails with an exception if
> an input result is not available.
> Expected Behaviour
> ---------------------------
> The redirect result from ActionA should be made and executed as normal. The
> validation interceptor should look for or use the input result of the action
> after the redirection has been made.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.