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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.7
    • 2.5
    • Plugin - Tiles
    • 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

              Unassigned Unassigned
              danielywoo Daniel Woo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: