PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, July 13, 2022

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

 July 13, 2022     jsf, message, parameters     No comments   

Issue

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?


Solution

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>


Answered By - BalusC
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing