Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The more elegant solution is probably by using multiple mappings for same Action. This way you don't need to set "struts.enable.DynamicMethodInvocation" to "true".

In JSP

Code Block
html
html
<s:form method="post" action="mySubmitAction">
    <s:submit value="Submit"/>
    <s:submit value="Clear" action="myClearAction"/>
</form>

...

Code Block
titleMyClearAction.java
public class MyClearAction extends MyAction {

    public String execute() throws Exception {
        // clear button logic here
        return SUCCESS;
    }
}

Credit: Andrea Ligios