The key attribute is for simple resource properties lookup only, without
MessageFormat. The <s:text> tag is able to deal with MessageFormat in
particular.

In your case you could either use specialized properties in your bundle:

reject.to=Reject to
reject.to.larry=%{getText('reject.to')} 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" />
</s:iterator>

See also:
https://cwiki.apache.org/confluence/display/WW/Localization
https://cwiki.apache.org/confluence/display/WW/Formatting+Dates+and+Numbers

- 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 messageResources.properties 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 role:
> 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
http://twitter.com/rgielen

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

Reply via email to