【问题标题】:Why isn't my f:param rendering inside h:outputText?为什么我的 f:param 不在 h:outputText 中呈现?
【发布时间】:2010-11-11 22:52:58
【问题描述】:

我有一个 message.properties 文件,其中包含:

success_text=多么酷……你猜到了这个数字。 {0} 是正确的! 

我有一个 JSF,其中包含:

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

不管是什么值,HTML都出来了:

太酷了……你猜到了这个数字。 {0} 是正确的!

为什么{0} 没有更改为&lt;f:param&gt; 中指示的值,我该如何解决?

【问题讨论】:

    标签: jsf parameters message


    【解决方案1】:

    &lt;h:outputText&gt; 不支持&lt;f:param&gt;。它仅适用于&lt;h:outputFormat&gt;

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-15
      • 1970-01-01
      • 1970-01-01
      • 2023-02-08
      • 1970-01-01
      相关资源
      最近更新 更多