|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) public @interface Action
This annotation can be used to control the URL that maps to a specific method in an Action class. By default, the method that is invoked is the execute method of the action and the URL is based on the package and class names. This annotation allows developers to change the URL or invoke a different method. This also allows developers to specify multiple URLs that will be handled by a single class or a single method.
This can also be used via the Actions
annotation
to associate multiple URLs with a single method.
Here's an example:
public class MyAction implements Action {
@Action("/foo/bar")
public String execute() {}
}
Optional Element Summary | |
---|---|
ExceptionMapping[] |
exceptionMappings
|
InterceptorRef[] |
interceptorRefs
Allows action methods to specify what interceptors must be applied to it. |
java.lang.String[] |
params
|
Result[] |
results
Allows action methods to specifically control the results for specific return values. |
java.lang.String |
value
Allows actions to specify different URLs rather than the default that is based on the package and action name. |
public abstract java.lang.String value
public abstract Result[] results
public abstract InterceptorRef[] interceptorRefs
public abstract java.lang.String[] params
{"key", "value", "key2", "value2"}
.public abstract ExceptionMapping[] exceptionMappings
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |