Result Annotation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Wiki Markup
{float:right|width=300px|background: #F0F0F0|border: solid navy}
  {info}
    See org.apache.struts2.config.Result annotation JavaDocs.
  {info}
{float}
  • name - Result name; default Action.SUCCESS
  • value - Value of result (result destination)
  • type - Type of result; default NullResult. For example:
    • NullResult.class
    • FreemarkerResult.class
    • PlainTextResult.class
    • VelocityResult.class
    • ServletDispatcherResult.class
    • ServletRedirectResult.class
    • ServletActionRedirectResult.class - Equivalent to redirect-action equivalent to the redirectAction type in XML config.
    • TilesResult.class
    • .. (for more result, please consult the API docs, and look for implementations of the XWork Result interface)
  • params - An Array of the parameters in the form {key1, value1, key2, value2}

@Result – Defining a Single Result

...

Code Block
titleDefining Multiple Results
@Results({
    @Result(name="success", value="/home.page", type=TilesResult.class),
    @Result(name="homeError", value="/homeError.page", type=tilesResultTilesResult.class)
})
public class HomeAction extends ActionSupport {
    // ....
}
Wiki Markup
{dynamictasklist:Page Tasks}{dynamictasklist}