You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Petit Pas De Lune <pe...@gmail.com> on 2007/06/07 14:43:20 UTC

[S2][Tiles] Ressource access from tiles.xml ?

Hello.
Is-it possible to internationalize some string definitions in
Tiles.xmlconfiguration file
with resources.properties ?

If yes, how can I do it ?

Thanks.

PPDL.

Re: [S2][Tiles] Ressource access from tiles.xml ?

Posted by Petit Pas De Lune <pe...@gmail.com>.
Thanks a lot Antonio for this trick.
I'm going to test it :)

Regards,

PPDL.

On 6/7/07, Antonio Petrelli <an...@gmail.com> wrote:
>
> 2007/6/7, Petit Pas De Lune <pe...@gmail.com>:
> > Hello.
> > Is-it possible to internationalize some string definitions in
> > Tiles.xmlconfiguration file
> > with resources.properties ?
> >
> > If yes, how can I do it ?
>
> Not directly, but it's not impossible.
> First of all, put in string attributes the keys:
>
> <put-attribute name="my.message" value="this.is.a.key" />
>
> In JSP template page, use:
>
> <tiles:importAttribute name="my.message" />
>
> This way, the key is stored as a page-scoped bean with the same name.
> At this point, you can use this bean as a key for the message to
> display.
>
> HTH
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: [S2][Tiles] Ressource access from tiles.xml ?

Posted by Antonio Petrelli <an...@gmail.com>.
2007/6/7, Petit Pas De Lune <pe...@gmail.com>:
> Hello.
> Is-it possible to internationalize some string definitions in
> Tiles.xmlconfiguration file
> with resources.properties ?
>
> If yes, how can I do it ?

Not directly, but it's not impossible.
First of all, put in string attributes the keys:

<put-attribute name="my.message" value="this.is.a.key" />

In JSP template page, use:

<tiles:importAttribute name="my.message" />

This way, the key is stored as a page-scoped bean with the same name.
At this point, you can use this bean as a key for the message to
display.

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org