Author
How to display a message resource value using an argument via <h:outputText>
Daniel Haupt
Greenhorn
Joined: May 22, 2006
Posts: 13
Hi there,
I'm using <h:outputText> to display messages from my resource bundles, e.g. in the following way:
My question now is: I have a message in my bundle using an argument, something like
How can I replace the {0}-Argument with a value using <h:outputText>?
Kind regards and thanks for your help
Daniel
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted Jan 13, 2009 11:55:36
0
You can't. You should be using h:outputFormat instead. The parameters are to be added using f:param.
Consult the JSF TLD documentation for details.
Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
Daniel Haupt
Greenhorn
Joined: May 22, 2006
Posts: 13
Thanks. Can you give a short example of how to use or link the corresponding spot in the tld documentation??
f:param value will be the value I want to replace the {0} with. But how do I have to name the parameter?
Kind regards
Daniel
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted Jan 14, 2009 05:31:05
0
You don´t need to name it. Just place f:param tags consecutively in the same order as the placeholders of the message.
Daniel Haupt
Greenhorn
Joined: May 22, 2006
Posts: 13
Mmh... sorry. It doesn't works for me...
Here's my code snippet...
I only got "Attachments for milestone {0}" rendered in my browser.
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted Jan 14, 2009 06:33:00
0
That´s not a standard JSF tag. Read the TLDDOC which come along the taglib you seem to prefer over the standard taglib how to use it.
Daniel Haupt
Greenhorn
Joined: May 22, 2006
Posts: 13
Works. It was not supported by the trinidad tag. Standard jsf tag works fine.
Thanks
Daniel
subject: How to display a message resource value using an argument via <h:outputText>