Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't my f:param rendering inside h:outputText?

I have a message.properties file which contains:

success_text=How cool... You have guessed the number.  {0} is correct! 

I have a JSF which contains:

<h:outputText value="#{msg.success_text}" >
    <f:param value="#{numberBean.userNumber}" />
</h:outputText>

No matter what the value of is, the HTML comes out:

How cool... You have guessed the number. {0} is correct!

Why isn't {0} changing to the value indicated in the <f:param> and how can I fix it?

like image 441
Brian Kessler Avatar asked Nov 11 '10 22:11

Brian Kessler


1 Answers

The <f:param> isn't supported by <h:outputText>. It works in <h:outputFormat> only.

<h:outputFormat value="#{msg.success_text}" >
    <f:param value="#{numberBean.userNumber}" />
</h:outputFormat>
like image 68
BalusC Avatar answered Nov 09 '22 06:11

BalusC