struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rene Gielen <>
Subject Re: getText syntax for jsp tags
Date Wed, 15 Aug 2012 06:50:49 GMT
The key attribute is for simple resource properties lookup only, without
MessageFormat. The <s:text> tag is able to deal with MessageFormat in

In your case you could either use specialized properties in your bundle: to{getText('')} Larry

or use the getText call in your tag:

<s:submit theme="simple" name="inspectorReject"
value="%{getText('label.button.reject',{'Larry'})}" align="center" />

or, if users is a collection to iterate over, containing user beans with
a property firstName:

<s:iterator value="users">
<s:submit theme="simple" name="inspectorReject"
value="%{getText('label.button.reject',{firstName})}" align="center" />

See also:

- René

Am 15.08.12 03:56, schrieb Cozart, Michele L:
> I've been searching for hours but can't find the correct syntax for sending parameters
into the file and using the resulting message in a tag.
> For instance, I have submit buttons that will say different things depending on the user's
> Reject to Larry
> Reject to Moe
> Reject to Curly
> Approve to ...
> <s:submit theme="simple" name="inspectorReject" key="label.button.reject" align="center"
> generates the button text of: Reject to {0}  if I add the parameter like, key="label.button.reject,
Role" I get label.button.reject Role
> Thanks,
> Michele Cozart

René Gielen

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message