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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development