...
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 "doSavesave" in FormAction class. The method must be public and take no arguments:
Code Block |
---|
public String doSavesave() throws Exception { ... return SUCCESS; } |
All the configuration for "actionName" will be used for "actionName!something" (interceptors, result types, etc...)
Results
Code Block | ||||
---|---|---|---|---|
| ||||
<result name="missing-data" type="dispatcher"> <param name="location">/form.jsp</param> <param name="parameterA">A</param> <param name="parameterB">B</param> </result> |
...