struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken McWilliams (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-3937) The annotation @Result can have an extra attribute to hold tiles attributes
Date Tue, 30 Apr 2013 22:10:17 GMT

    [ https://issues.apache.org/jira/browse/WW-3937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646055#comment-13646055
] 

Ken McWilliams commented on WW-3937:
------------------------------------

Yes. The way it is now allows for you to define what you need in Java.
But it would be nice if configuration can be done completely within the
annotations.

There are two types of tiles attributes that need to be specified among the
properties.

"Attributes" which in most cases are satisfied with  name - value pairs
where both name and value are strings.

"List-Attributes" which in most cases are satisfied with name(String) -
List of Strings

Setting up a way to handle these parameters I think would satisfy 90% of
the cases for the remaining 10%  you can just pragmatically define a list
of attributes to do what you need (what is implemented in the above
example.

Any suggestions?






                
> The annotation @Result can have an extra attribute to hold tiles attributes
> ---------------------------------------------------------------------------
>
>                 Key: WW-3937
>                 URL: https://issues.apache.org/jira/browse/WW-3937
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Tiles
>    Affects Versions: 2.3.7
>            Reporter: Daniel Woo
>            Priority: Minor
>             Fix For: 2.3.15
>
>
> Currently the @Result annotation for tiles can only specify a location to render, e.g.
> {code:java}
> @Action(value = "/home", results = {@Result(name = "success", location = "home", type
= "tiles")})
> {code}
> What I want is to add a new attribute like this:
> {code:java}
> @Action(value = "/home", results = {@Result(name = "success", location = "home", tilesAttr={"loadcss",
"/css/home.css"}, type = "tiles")})
> {code}
> The reason is to utilize wildcard tiles definition. Suppose we have the wildcard tiles
definition below,
> {code:xml}
> <definition name="*.*.*" extends="{3}-layout">
>     <put-attribute name="body" value="/view/{1}/{2}.jsp"/>
>     <put-attribute name="loadcss" value=""/>
> </definition>
> {code}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message