Versions Compared

Key

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

...

The optional "method" parameter tells WebWork which method to call based upon this action. If you leave the method parameter blank, WebWork will call the method execute() by default. If there is no execute() method and no method specified in the xml file, WebWork will throw an exception.

Also, if you use ServletDispatcher to map your actions, you can tell WebWork to invoke "doSomething" method in your action by using the pattern "actionName!something" in your form. For example, "formTest!save.action" will invoke the method "doSave" in FormAction class. The method must be public and take no arguments:

Code Block

  public String doSave() throws Exception
  {
      ...
      return SUCCESS;
  }

Results

Code Block
xml
xml
<result name="missing-data" type="dispatcher">
    <param name="location">/form.jsp</param>
</result>

...