...
As from Struts version 2.5.3 it's possible accessing defined I18N keys and values on a ValueStack
using S2
prefix when defining an expression in tiles definition, e.g.:
Code Block | ||||
---|---|---|---|---|
| ||||
<definition name="home" extends="logged-in"> <put-attribute name="title" expression="S2:home.titleactionProperty"/> <put-attribute name="body" value="/WEB-INF/tiles/home.jsp"/> </definition> |
In such case Tiles will delegate evaluation of the expression to Struts and first a key from I18N resources will be looked for and then ValueStack
will be evaluated. If both evaluations return null
, the expression will be returned.and ValueStack
will be examined to evaluate the expression.
I18N
Instead of defining new tiles definitions per supported language (i.e.: tiles.xml
, tiles_de.xml
, tiles_pl.xml
) you can use I18N
prefix to evaluate provided expression as a key in Struts resource bundles.
Code Block | ||||
---|---|---|---|---|
| ||||
<definition name="home" extends="logged-in">
<put-attribute name="title" expression="I18N:home.title"/>
<put-attribute name="body" value="/WEB-INF/tiles/home.jsp"/>
</definition> |
Info |
---|
As from Struts 2.3.28, the plugin automatically loads all Tiles definitions matching the following pattern |
...