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

ASF GitHub Bot commented on WW-4594:
------------------------------------

Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/85#discussion_r51285182
  
    --- Diff: 
plugins/tiles/src/test/java/org/apache/struts2/tiles/TilesTestActionSingleAnnotation.java
 ---
    @@ -0,0 +1,49 @@
    +package org.apache.struts2.tiles;
    +
    +import org.apache.struts2.tiles.annotation.TilesAddAttribute;
    +import org.apache.struts2.tiles.annotation.TilesAddListAttribute;
    +import org.apache.struts2.tiles.annotation.TilesDefinition;
    +import org.apache.struts2.tiles.annotation.TilesPutAttribute;
    +import org.apache.struts2.tiles.annotation.TilesPutListAttribute;
    +
    +@TilesDefinition(
    +        name = "definition-name", 
    +        extend = "base-definition", 
    +        preparer = "preparer", 
    +        role = "role", 
    +        template = "template", 
    +        templateExpression = "templ*", 
    +        templateType = "type",
    +        putAttributes = {
    +                @TilesPutAttribute(
    +                        cascade = true, 
    +                        expression = "lang:expr", 
    +                        name = "put-attr", 
    +                        role = "attr-role", 
    +                        type = "attr-type", 
    +                        value = "attr-val")
    +        },
    +        putListAttributes = {
    +                @TilesPutListAttribute(
    +                        cascade = true, 
    +                        inherit = true, 
    +                        name = "list-name", 
    +                        role = "list-role",
    +                        addAttributes = {
    +                                @TilesAddAttribute(
    +                                        expression = "list-attr-expr", 
    +                                        role = "list-attr-role", 
    +                                        type = "list-attr-type", 
    +                                        value = "list-attr-val")
    +                        },
    +                        addListAttributes = {
    +                                @TilesAddListAttribute(
    +                                        role = "list-list-attr-role", 
    +                                        addAttributes = 
{@TilesAddAttribute("list-list-add-attr")})
    +                        }
    +                )
    +        }
    +)
    --- End diff --
    
    Extreme example :D


> Configure TilesDefs by annotating Actions
> -----------------------------------------
>
>                 Key: WW-4594
>                 URL: https://issues.apache.org/jira/browse/WW-4594
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Plugin - Tiles
>            Reporter: Christoph Nenning
>            Assignee: Christoph Nenning
>             Fix For: 2.5
>
>
> Large applications often consist of hundrets of actions. IMO it is a major 
> benefit of struts-convention-plugin that it is not necessary to configure all 
> those actions in xml files. As xml files would become huge and hard to 
> maintain. The same applies to tiles xml files. Currently it is necessary to 
> configure tiles-definitions for all those actions in xml files which makes 
> them huge and hard to maintain.
> It would be great if configuration of tiles-definitions could be done by 
> annotating actions, in a similar way actions can be configured with 
> annotations from convention-plugin.
> This somewhat relates to WW-3937 and WW-4161



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to