|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Result
This annotation is used to specify non-convention based results for the Struts convention handling. This annotation is added to a class and can be used to specify the result location for a specific result code from an action method. Furthermore, this can also be used to handle results only for specific action methods within an action class (if there are multiple).
When this annotation is used on an action class, it generates results that are applicable to all of the actions URLs defined in the class. These are considered global results for that class. Here is an example of a global result:
@Result(name="fail", location="failed.jsp")
public class MyAction {
}
This annotation can also be used inside an Action
annotation
on specific methods. This usage will define results for that specific
action URL. Here is an example of an action URL specific result:
@Action(results={@Result(name="success", location="/", type="redirect")})
public String execute() {
}
Optional Element Summary | |
---|---|
java.lang.String |
location
|
java.lang.String |
name
|
java.lang.String[] |
params
|
java.lang.String |
type
|
public abstract java.lang.String name
public abstract java.lang.String location
public abstract java.lang.String type
public abstract java.lang.String[] params
{"key", "value", "key2", "value2"}
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |