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

Allow directly accessing I18N keys from Tiles defintions

    Details

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

      Description

      It'd be better to allow directly fetching I18N keys from Struts properties instead of using multiple tiles.xml definitions. The latest version of Tiles supports expression languages so it can be possible to add support for Struts' internals.

      <definition name="home" extends="logged-in">
        <put-attribute name="title" expression="S2:home.title"/>
        <put-attribute name="body" value="/WEB-INF/tiles/home.jsp"/>
      </definition>
      

      and home.title should be first evaluated as a key in resource bundle and then as a value from ValueStack.

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Struts-JDK6-support-2.3 #1048 (See https://builds.apache.org/job/Struts-JDK6-support-2.3/1048/)
        WW-4685 Supports evaluating expressions from tiles definitions as a (lukaszlenart: rev 156db8e5dfb82c394564d8268d9ef553f28356af)

        • (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
        • (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java
          WW-4685 Uses dedicated prefixes to access I18N and Struts internals (lukaszlenart: rev 431e50e92242b24b98f36eaec9ac84c938bb82b6)
        • (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java
        • (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/I18NAttributeEvaluator.java
        • (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
          WW-4685 Adjusts cherry pick to 2.3.x (lukaszlenart: rev 81371e09c54a1ba9c2d4d3207567263cc6e62474)
        • (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/I18NAttributeEvaluator.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK6-support-2.3 #1048 (See https://builds.apache.org/job/Struts-JDK6-support-2.3/1048/ ) WW-4685 Supports evaluating expressions from tiles definitions as a (lukaszlenart: rev 156db8e5dfb82c394564d8268d9ef553f28356af) (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java WW-4685 Uses dedicated prefixes to access I18N and Struts internals (lukaszlenart: rev 431e50e92242b24b98f36eaec9ac84c938bb82b6) (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/I18NAttributeEvaluator.java (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java WW-4685 Adjusts cherry pick to 2.3.x (lukaszlenart: rev 81371e09c54a1ba9c2d4d3207567263cc6e62474) (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/I18NAttributeEvaluator.java
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 81371e09c54a1ba9c2d4d3207567263cc6e62474 in struts's branch refs/heads/support-2-3 from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=81371e0 ]

        WW-4685 Adjusts cherry pick to 2.3.x

        Show
        jira-bot ASF subversion and git services added a comment - Commit 81371e09c54a1ba9c2d4d3207567263cc6e62474 in struts's branch refs/heads/support-2-3 from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=81371e0 ] WW-4685 Adjusts cherry pick to 2.3.x
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 431e50e92242b24b98f36eaec9ac84c938bb82b6 in struts's branch refs/heads/support-2-3 from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=431e50e ]

        WW-4685 Uses dedicated prefixes to access I18N and Struts internals

        Show
        jira-bot ASF subversion and git services added a comment - Commit 431e50e92242b24b98f36eaec9ac84c938bb82b6 in struts's branch refs/heads/support-2-3 from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=431e50e ] WW-4685 Uses dedicated prefixes to access I18N and Struts internals
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 156db8e5dfb82c394564d8268d9ef553f28356af in struts's branch refs/heads/support-2-3 from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=156db8e ]

        WW-4685 Supports evaluating expressions from tiles definitions as a Struts values

        Show
        jira-bot ASF subversion and git services added a comment - Commit 156db8e5dfb82c394564d8268d9ef553f28356af in struts's branch refs/heads/support-2-3 from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=156db8e ] WW-4685 Supports evaluating expressions from tiles definitions as a Struts values
        Hide
        aleksandr-m Aleksandr Mashchenko added a comment -

        Definitely

        Show
        aleksandr-m Aleksandr Mashchenko added a comment - Definitely
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        I think at some time we must stop backporting things to 2.3.x

        Show
        lukaszlenart Lukasz Lenart added a comment - I think at some time we must stop backporting things to 2.3.x
        Hide
        aleksandr-m Aleksandr Mashchenko added a comment -

        Great! Can it be backported to 2.3?

        Show
        aleksandr-m Aleksandr Mashchenko added a comment - Great! Can it be backported to 2.3?
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Struts-JDK7-master #519 (See https://builds.apache.org/job/Struts-JDK7-master/519/)
        WW-4685 Uses dedicated prefixes to access I18N and Struts internals (lukaszlenart: rev a5f3bdd1479bbc3957e2dd266a7e6069f1c36380)

        • (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/I18NAttributeEvaluator.java
        • (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
        • (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #519 (See https://builds.apache.org/job/Struts-JDK7-master/519/ ) WW-4685 Uses dedicated prefixes to access I18N and Struts internals (lukaszlenart: rev a5f3bdd1479bbc3957e2dd266a7e6069f1c36380) (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/I18NAttributeEvaluator.java (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit a5f3bdd1479bbc3957e2dd266a7e6069f1c36380 in struts's branch refs/heads/master from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=a5f3bdd ]

        WW-4685 Uses dedicated prefixes to access I18N and Struts internals

        Show
        jira-bot ASF subversion and git services added a comment - Commit a5f3bdd1479bbc3957e2dd266a7e6069f1c36380 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=a5f3bdd ] WW-4685 Uses dedicated prefixes to access I18N and Struts internals
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Struts-JDK7-master #518 (See https://builds.apache.org/job/Struts-JDK7-master/518/)
        WW-4685 Supports evaluating expressions from tiles definitions as a (lukaszlenart: rev 1bed00d3d7269bbe11cd3ec1711400e050ef57b4)

        • (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java
        • (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #518 (See https://builds.apache.org/job/Struts-JDK7-master/518/ ) WW-4685 Supports evaluating expressions from tiles definitions as a (lukaszlenart: rev 1bed00d3d7269bbe11cd3ec1711400e050ef57b4) (add) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsAttributeEvaluator.java (edit) plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1bed00d3d7269bbe11cd3ec1711400e050ef57b4 in struts's branch refs/heads/master from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=1bed00d ]

        WW-4685 Supports evaluating expressions from tiles definitions as a Struts values

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1bed00d3d7269bbe11cd3ec1711400e050ef57b4 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=1bed00d ] WW-4685 Supports evaluating expressions from tiles definitions as a Struts values
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Done

        Show
        lukaszlenart Lukasz Lenart added a comment - Done
        Show
        lukaszlenart Lukasz Lenart added a comment - Docs https://cwiki.apache.org/confluence/display/WW/Tiles+Plugin#TilesPlugin-AccessingStrutsattributes

          People

          • Assignee:
            lukaszlenart Lukasz Lenart
            Reporter:
            lukaszlenart Lukasz Lenart
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development