I am using JSF 1.2
I am trying to print text using <h:outputtext>
<h:outputText id="warningDose" styleClass="redText" value="#{templatePrescriptionMaintenanceBackingBean.doseWarningText}"></h:outputText>
Now this variable contains text with html tags. <b>
,<i>
etc...
But that displays content as it is instead of actual bold or italic html output.
Is there any way we can make this <h:outputText>
such that it gives html response?
You should set in the h:outputText tag:
escape="false"
But remember that mixing "view" construction (i.e., creating a string with HTML tags) between the JSF view page and the underlying bean is kinda bad practice. All the "view production" should be in the view page.
Just set it to not escape.
<h:outputText id="warningDose" escape="false" styleClass="redText" value="#{templatePrescriptionMaintenanceBackingBean.doseWarningText}"></h:outputText>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With