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

The annotation @Result can have an extra attribute to hold tiles attributes

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.7
    • Fix Version/s: 2.5
    • Component/s: Plugin - Tiles
    • Labels:
      None

      Description

      Currently the @Result annotation for tiles can only specify a location to render, e.g.

      @Action(value = "/home", results = {@Result(name = "success", location = "home", type = "tiles")})
      

      What I want is to add a new attribute like this:

      @Action(value = "/home", results = {@Result(name = "success", location = "home", tilesAttr={"loadcss", "/css/home.css"}, type = "tiles")})
      

      The reason is to utilize wildcard tiles definition. Suppose we have the wildcard tiles definition below,

      <definition name="*.*.*" extends="{3}-layout">
          <put-attribute name="body" value="/view/{1}/{2}.jsp"/>
          <put-attribute name="loadcss" value=""/>
      </definition>
      

      The tiles attribute 'loadcss' should be set dynamically, or specified in the annotation. Currently since the tiles plugin does not support the attribute yet, we have to do that in the tiles configuration file with <put-attribute>, that means we have to explicitly define each tiles definition without wildcard support.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              danielywoo Daniel Woo

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment