DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
The @Result annotation allows the definition of Action results in the Action class rather than an XML file.
The @Result annotation lives at the Action class level and not the method level. This matches what is found in an XML-based Action configuration. Do not be tempted to annotate your Action's methods; it will not work.
In order for @Result and @Results annotations to be configured correctly you must set the actionPackages filter init-param to a comma-separated list of packages containing the annotated Action classes. See Zero Configuration for further information; there are Action class naming conventions if you don't implement the Action interface and other tidbits there.
@Result Annotation Parameters
- name - Result name; default
Action.SUCCESS - value - Value of result (result destination)
- type - Type of result; default
NullResult. For example:NullResult.classFreemarkerResult.classPlainTextResult.classVelocityResult.classServletDispatcherResult.classServletRedirectResult.classServletActionRedirectResult.class- equivalent to theredirectActiontype in XML configTilesResult.class- .. (for more result, please consult the API docs, and look for implementations of the XWork
Resultinterface)
- params - An Array of the parameters in the form {key1, value1, key2, value2}
@Result – Defining a Single Result
Map the "success" result (explicitly named) to a Tile definition named "/home.page".
@Results – Defining Multiple Results
Defines a set of results for an Action.
1 Comment
Jan Normann Nielsen
This page needs to document how
paramsfor theResultannotation are used.