Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Note

You can be also interested in checking the page HTML form buttons HOWTO

Original solution

Introduction

...

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