Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-1865

Simplify Result Type Annotation by allowing same result types as XML configuration

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.6
    • 2.1.6
    • Plugin - CodeBehind
    • None

    Description

      When using Result annotations, we currently have to use class references to configure the result type. It would be much simpler and more consistent if we can use the same result types as the XML configuration, such as "redirect-action", "tiles", etc, instead of having to use class names like ServletActionRedirectResult .class and TilesResult.class.

      So instead of this:

      @Result(name="success", value="main", type=ServletActionRedirectResult .class)
      public class HomeAction extends ActionSupport {
      // ...
      }

      Be able to do this:

      @Result(name="success", value="main", type="redirect-action")
      public class HomeAction extends ActionSupport {
      // ...
      }

      or if we are keeping backwards compatiblity, something like this:

      @Result(name="success", value="main", typeName="redirect-action")
      public class HomeAction extends ActionSupport {
      // ...
      }

      Attachments

        Activity

          People

            jholmes James Holmes
            alkira Alex Kira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: