You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Al Sutton (JIRA)" <ji...@apache.org> on 2007/06/04 08:01:31 UTC

[jira] Created: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

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: Interceptors
    Affects Versions: 2.0.6
         Environment: Produced on Windows Vista, Java 1.5.0_11, and Tomcat 5.5.23
            Reporter: Al Sutton


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.


[jira] Updated: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Kedar Choudhary (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Updated: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-1963:
-----------------------------

    Affects Version/s: 2.0.7
                       2.0.8
                       2.0.9
        Fix Version/s:     (was: Future)
                       2.0.11

> 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: 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.0.11
>
>
> 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.


[jira] Commented: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43942#action_43942 ] 

Musachy Barroso commented on WW-1963:
-------------------------------------

I think Kedar is totally right about this. There isn't anything that the workflow or scope interceptor can do by themselves, because they are doing what are supposed to. Switching their order should take care of it.

> 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.3
>
>
> 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.


[jira] Commented: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Al Sutton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43573#action_43573 ] 

Al Sutton commented on WW-1963:
-------------------------------

To illustrate another side effect of this problem, consider try following;

1) You have a View Action which displays all of the data of a specific type, which uses the StoreInterceptor in retreive in order to show confirmation messages from an Update action.

2) You have an Edit Action which sends the user to edit.jsp via the dispatcher result type. edit.jsp has a menu taking the user to other places in the app.

3) You have an Update Action which is called by submitting a form on edit.jsp, this can return the user to edit.jsp using the dispatcher if there is a problem with the form data, or it can take the user to the View Action via a redirect if everything is OK. The Update Action uses the StoreInterceptor in STORE mode in order to send a confirmation back to the View Action.

Now, if the user gets to the edit stage submits the form, but has made a mistake which sends them back to edit.jsp, clicks on the menu to go to another action they end up seeing the error message twice, once when the get redirected back to edit.jsp from the UpdateAction, and a second time when they click on any of the links from the menu on edit.jsp.


This can't be intentional behaviour because to a user this is just confusing.

> 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.


[jira] Commented: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Al Sutton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42262 ] 

Al Sutton commented on WW-1963:
-------------------------------

Think about it like this;

X.jsp is a generic page which can show s:errormesssages and has a link to
ActionB

ActionB populates a java.util.List based on the results of a database query
and has a success result which sends the user to Y.jsp (below), and an error
result which sends the user to X.jsp.

Y.jsp which shows the list in an s:select and asks for other data. The data
is submitted to ActionA

ActionA which validates the data from Y.jsp

If validation fails in ActionA I would like to display Y.jsp with the
s:select populated. The only way to populate the options for the s:select is
via ActionB. Heres the problem; If an actionError has been added in ActionA
and the error result sends the user back to ActionB in order to populate the
list, the user ends up at X.jsp which is the error result of ActionB, not
back at Y.jsp with the list populated.

So In a nutshell; As I see it any validation errors in ActionA should send
the user to ActionA's error result, but once they're at that error result
processing should continue as normal (i.e. allowing ActionB to run and
return its success result). Without this you end up with actions not being
able to handle error results for other actions.



> 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: 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.0.12
>
>
> 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.


[jira] Commented: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42259 ] 

Don Brown commented on WW-1963:
-------------------------------

Hmm...I'm not understanding the problem.  If ActionA added an error and redirected to ActionB, then shouldn't the validation interceptor think that ActionB's validation had failed and forward to its input result?

> 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: 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.0.12
>
>
> 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.


[jira] Updated: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-1963:
-----------------------------

    Fix Version/s:     (was: 2.0.11)
                   2.0.12

> 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: 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.0.12
>
>
> 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.


[jira] Commented: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43800#action_43800 ] 

Don Brown commented on WW-1963:
-------------------------------

See also WW-2599

> 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.3
>
>
> 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.


[jira] Resolved: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown resolved WW-1963.
---------------------------

       Resolution: Not A Problem
    Fix Version/s:     (was: 2.1.3)

See workaround

> 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
>
> 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.


[jira] Updated: (WW-1963) Incorrect result used if using message store interceptor, validation, and action errors.

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted updated WW-1963:
---------------------------

    Fix Version/s: Future

Setting Fix Version to "future" for issues without a set fix version. 


> 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: Interceptors
>    Affects Versions: 2.0.6
>         Environment: Produced on Windows Vista, Java 1.5.0_11, and Tomcat 5.5.23
>            Reporter: Al Sutton
>             Fix For: Future
>
>
> 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.