0

I'm using Primefaces 5.1. In my student I need style particular style in particular text.Below code I try It will show error(The value of attribute "value" must not contain the '<' character). So I replace < to &< and &&gt for > that time I faces error(The entity name must immediately follow the '&' in the entity reference)

<p:outputPanel>
<h:outputText styleClass="noWrap" escape="false" 
value="#{common.ConfirmMessage1} <b style='color:red'>'
#{student.numberOfUserFound}'</b>"/>
</p:outputPanel>

My doubt is separate text is solution or any other way?

Karthik
  • 21
  • 1
  • 11

1 Answers1

2

Just don't use <h:outputText>. It has no technical necessity in this specific case.

<p:outputPanel>
    <span class="noWrap">
        #{common.ConfirmMessage1}
        <b style='color:red'>'#{student.numberOfUserFound}'</b>
    </span>
</p:outputPanel>

See also:


That being said, I suggest to take a step back from JSF and start learning some basic HTML first. JSF will then be easier to understand. In the context of this question, JSF is just a HTML code generator.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555