struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: [S2] message properties
Date Fri, 21 Dec 2007 14:07:46 GMT
--- Desbois Arnaud <Arnaud.Desbois@thomson.net> wrote:
> <s:set var="msg" value="%{getText('message.remove', item.name)}" />
> <s:set var="msg" value="%{getText('message.remove', {item.name})}" />
> <s:set var="msg" value="%{getText('message.remove', #{item.name})}" />

I would have thought the second example would have worked; I use nearly the
same syntax with an iterator value and it works fine (although I'm using
<s:property.../>).

I just verified that if I have an action property "foo" that the following
works.

<s:set name="meh" value="%{getText('test.msg', {foo})}"/>
<s:property value="#meh"/>

> Also, how I can retrieve a message from the resources.properties from a
> freemarker template (.ftl file)?

You can always use an <s:property.../> tag where the value is the getText
call. All the S2 tags can be used in a FreeMarker template, AFAIK.

d.


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


Mime
View raw message