mirror of
https://github.com/apache/struts.git
synced 2026-08-11 09:36:57 +00:00
2a24340dc5
git-svn-id: https://svn.apache.org/repos/asf/struts/action2/trunk@418416 13f79535-47bb-0310-9956-ffa450edef68
46 lines
1.0 KiB
Java
46 lines
1.0 KiB
Java
package org.apache.struts2;
|
|
|
|
/**
|
|
* Default action interface. Provided purely for user convenience. Struts does not require actions to implement any
|
|
* interfaces. Actions need only implement a public, no argument method which returns {@code String}. If a user does
|
|
* not specify a method name, Struts defaults to {@code execute()}.
|
|
*
|
|
* <p>For example:
|
|
*
|
|
* <pre>
|
|
* static import ResultNames.*;
|
|
*
|
|
* public class MyAction <b>implements Action</b> {
|
|
*
|
|
* public String execute() {
|
|
* return SUCCESS;
|
|
* }
|
|
* }
|
|
* </pre>
|
|
*
|
|
* <p>is equivalent to:
|
|
*
|
|
* <pre>
|
|
* static import ResultNames.*;
|
|
*
|
|
* public class MyAction {
|
|
*
|
|
* public String execute() {
|
|
* return SUCCESS;
|
|
* }
|
|
* }
|
|
* </pre>
|
|
*
|
|
* @author crazybob@google.com (Bob Lee)
|
|
*/
|
|
public interface Action {
|
|
|
|
/**
|
|
* Executes this action.
|
|
*
|
|
* @return result name which matches a result name from the action mapping in the configuration file. See {@link
|
|
* ResultNames} for common suggestions.
|
|
*/
|
|
String execute();
|
|
}
|