You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "David (JIRA)" <ji...@apache.org> on 2009/01/29 23:02:46 UTC

[jira] Created: (WW-2970) Param set on chained action is re-set on all actions in chain

Param set on chained action is re-set on all actions in chain
-------------------------------------------------------------

                 Key: WW-2970
                 URL: https://issues.apache.org/struts/browse/WW-2970
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
    Affects Versions: 2.1.6
         Environment: Windows XP SP2.  WebLogic Server 10.0 MP1.  Java HotSpot(TM) Server VM Version 1.5.0_11-b03
            Reporter: David


If a param is set on an action in a chain through struts.xml, it will be set on all subsequent actions in the chain, thus overwriting any values that may have been set by the actions themselves.

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


[jira] Commented: (WW-2970) Param set on chained action is re-set on all actions in chain

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

Musachy Barroso commented on WW-2970:
-------------------------------------

this seems weird, if it is broken then parameter copying in chaining is broken in 2.1.6+.

> Param set on chained action is re-set on all actions in chain
> -------------------------------------------------------------
>
>                 Key: WW-2970
>                 URL: https://issues.apache.org/struts/browse/WW-2970
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2.  WebLogic Server 10.0 MP1.  Java HotSpot(TM) Server VM Version 1.5.0_11-b03
>            Reporter: David
>             Fix For: 2.2.0
>
>         Attachments: chainapp.zip
>
>
> If a param is set on an action in a chain through struts.xml, it will be set on all subsequent actions in the chain, thus overwriting any values that may have been set by the actions themselves.

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


[jira] Resolved: (WW-2970) Param set on chained action is re-set on all actions in chain

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

Musachy Barroso resolved WW-2970.
---------------------------------

    Resolution: Won't Fix

ok, this became the side effect of something else which I am not sure what it was. Here is the problem:
When StaticParamsInterceptor runs on action1 then the static param is added to the request param list, when chaining happens all fields are copied from action1 to action2, and the field is set as expected, but when the params interceptor runs on action2, then it "sees" the static param as a request param because the StaticParamsInterceptor added it to the request params, and then it sets the field in action2 to the static value.

Take a look at :
http://jira.opensymphony.com/browse/XW-709

The solution is to configure your "staticParams" interceptor and set the "merge" attribute to false.

> Param set on chained action is re-set on all actions in chain
> -------------------------------------------------------------
>
>                 Key: WW-2970
>                 URL: https://issues.apache.org/struts/browse/WW-2970
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2.  WebLogic Server 10.0 MP1.  Java HotSpot(TM) Server VM Version 1.5.0_11-b03
>            Reporter: David
>             Fix For: 2.2.0
>
>         Attachments: chainapp.zip
>
>
> If a param is set on an action in a chain through struts.xml, it will be set on all subsequent actions in the chain, thus overwriting any values that may have been set by the actions themselves.

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


[jira] Updated: (WW-2970) Param set on chained action is re-set on all actions in chain

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

Musachy Barroso updated WW-2970:
--------------------------------

    Fix Version/s: 2.2.0

> Param set on chained action is re-set on all actions in chain
> -------------------------------------------------------------
>
>                 Key: WW-2970
>                 URL: https://issues.apache.org/struts/browse/WW-2970
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2.  WebLogic Server 10.0 MP1.  Java HotSpot(TM) Server VM Version 1.5.0_11-b03
>            Reporter: David
>             Fix For: 2.2.0
>
>         Attachments: chainapp.zip
>
>
> If a param is set on an action in a chain through struts.xml, it will be set on all subsequent actions in the chain, thus overwriting any values that may have been set by the actions themselves.

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


[jira] Commented: (WW-2970) Param set on chained action is re-set on all actions in chain

Posted by "Antoine W (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47124#action_47124 ] 

Antoine W commented on WW-2970:
-------------------------------

It looks like I have the same behavior with tomcat. Params interceptor is re-setting all parameters from get/post, before each chained action is called.
So if action1 updates one parameter, then chains to action2, action2 will still get the initial value reseted by Params.
This is quite annoying... 

> Param set on chained action is re-set on all actions in chain
> -------------------------------------------------------------
>
>                 Key: WW-2970
>                 URL: https://issues.apache.org/struts/browse/WW-2970
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2.  WebLogic Server 10.0 MP1.  Java HotSpot(TM) Server VM Version 1.5.0_11-b03
>            Reporter: David
>         Attachments: chainapp.zip
>
>
> If a param is set on an action in a chain through struts.xml, it will be set on all subsequent actions in the chain, thus overwriting any values that may have been set by the actions themselves.

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


[jira] Updated: (WW-2970) Param set on chained action is re-set on all actions in chain

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

David updated WW-2970:
----------------------

    Attachment: chainapp.zip

The attached sample webapp demonstrates a problem with action chaining in Struts 2.1.6 using WebLogic server.  A parameter set on an action class in struts.xml is re-set on the chained action, thus overwriting any values set in other action classes earlier in the chain.

Below are steps to reproduce the issue.

Setup:
1)  Unzip chainapp.zip
2)  In build.xml, modify the following properties:
  -wls.lib.dir
  -wls.serverName
  -wls.hostname
  -wls.port
  -wls.username
  -wls.password

Test 1 (using Struts 2.1.2, to show expected/correct behavior)
1)  Run the ant task "deploy"
2)  Open a web browser to http://localhost:<port>/chainapp/chainTest
3)  Check stdout, you should see the following:

Action1.execute()
Action1.execute() : getPageName() = InitialPagename
Action1.execute() : getPageName() = PageNameFromAction1
Action2.execute()
Action2.execute() : getPageName() = PageNameFromAction1


Test 1 (using Struts 2.1.6, to demonstrate the bug)
1)  Open resources/pom_ChainTest.xml
2)  Comment out the section titled "Struts 2.1.2"
3)  Uncomment the section titled "Struts 2.1.6"
4)  Repeat steps from Test 1
5)  Check stdout, you should see the following:

Action1.execute()
Action1.execute() : getPageName() = InitialPagename
Action1.execute() : getPageName() = PageNameFromAction1
Action2.execute()
Action2.execute() : getPageName() = InitialPagename


> Param set on chained action is re-set on all actions in chain
> -------------------------------------------------------------
>
>                 Key: WW-2970
>                 URL: https://issues.apache.org/struts/browse/WW-2970
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2.  WebLogic Server 10.0 MP1.  Java HotSpot(TM) Server VM Version 1.5.0_11-b03
>            Reporter: David
>         Attachments: chainapp.zip
>
>
> If a param is set on an action in a chain through struts.xml, it will be set on all subsequent actions in the chain, thus overwriting any values that may have been set by the actions themselves.

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