You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dale Newfield <da...@newfield.org> on 2010/08/02 15:54:52 UTC
Re: getting label from property
On 7/28/10 2:16 PM, Ryan Beckes wrote:
> I'm working my way through properties and I'm kind of stuck. I have a
> properties file (package.properties) with a "message" entry...
>
> Index.message= Color
>
> ... I am able to pull this message via the s:text tag, so I know it's
> available in the value stack
That inference is mistaken. The value isn't on the value stack, it's
available from the i18n code.
> but when I try to pull the same message for
> the select label below, it does not work. I've also tried %{message} and
> %{getText('message')}.
%{message} evaluates to a getMessage() call on your action (if that
exists, otherwise it'll look for that call on other values lower down in
the valuestack).
%{getText('message')} will call getText('message') on your action.
Assuming you've extended ActionSupport, then this will look up 'message'
in package.properties, but you haven't indicated there is such a value
there.
Try: "%{getText('Index.message')}"
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org