@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() {
}
public abstract String[] name
public abstract String location
public abstract String type
public abstract String[] params
{"key", "value", "key2", "value2"}
.Copyright © 2000–2024 Apache Software Foundation. All rights reserved.