Struts 2
  1. Struts 2
  2. WW-2056

ActionMapper: submit tag method attribute apply to all action(include action result)

    Details

    • Flags:
      Important

      Description

      1. In JSP:
        <s:submit value="Submit"/>
        <s:submit method="someMethod222" value="Submit 222"/>
      2. In config file:
        <action name="someAction" class="SomeClass" method="someMethod">
        <result name="success">
        otherAction.action
        </result>
        </action>
        <action name="otherAction" class="SomeClass2" method="otherMethod">
        <result name="success">
        /someFile.jsp
        </result>
        </action>
        Then click "Submit 222", it will call SomeClass#someMethod222, then return to "otherAction.action" and call SomeClass2#someMethod222, not "otherMethod" method. Why not call method "otherMethod" I config?
        If config it like this:
        <action name="someAction" class="SomeClass" method="someMethod">
        <result name="success">
        otherAction!otherMethod.action
        </result>
        </action>
        It's will call SomeClass2#otherMethod. Is it a rule, or a bug? If it's a rule, it's so ugly, when I change the method name "otherMethod" to new name, I must any action result. Tks.

        Activity

        Lukasz Lenart made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.2.1 [ 12315170 ]
        Fix Version/s 2.2.x [ 12314679 ]
        Resolution Won't Fix [ 2 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.2.x [ 12314679 ]
        Fix Version/s 2.2.0 [ 12314680 ]
        Hide
        Lukasz Lenart added a comment -

        Could you verify is it still an issue with the current Struts 2 version?

        Show
        Lukasz Lenart added a comment - Could you verify is it still an issue with the current Struts 2 version?
        Lukasz Lenart made changes -
        Fix Version/s 2.2.0 [ 12314680 ]
        Fix Version/s 2.1.9 [ 12314678 ]
        Jeff Turner made changes -
        Project Import Mon Feb 01 01:17:42 UTC 2010 [ 1264987062082 ]
        musachy made changes -
        Fix Version/s Future [ 21530 ]
        Fix Version/s 2.1.9 [ 21930 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status (temporary) [ 46838 ] Struts - editable closed status [ 50097 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status [ 42185 ] Struts - editable closed status (temporary) [ 46838 ]
        Don Brown made changes -
        Fix Version/s 2.1.2 [ 21861 ]
        Fix Version/s Future [ 21530 ]
        Hide
        Don Brown added a comment -

        I wonder if the issue is maybe in how the action chaining is happening. Why not use an action redirect?

        Show
        Don Brown added a comment - I wonder if the issue is maybe in how the action chaining is happening. Why not use an action redirect?
        Hide
        James Holmes added a comment -

        This seems like a bug to me. I would expect the same behavior as Cleven is expecting. The method should only be for the first action, not any subsequent actions.

        Show
        James Holmes added a comment - This seems like a bug to me. I would expect the same behavior as Cleven is expecting. The method should only be for the first action, not any subsequent actions.
        James Holmes made changes -
        Fix Version/s 2.0.11 [ 21860 ]
        Fix Version/s 2.0.12 [ 21861 ]
        James Holmes made changes -
        Fix Version/s 2.0.11 [ 21860 ]
        Jeff Turner made changes -
        Field Original Value New Value
        Workflow Struts [ 41596 ] Struts - editable closed status [ 42185 ]
        Cleven Lee created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Cleven Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development