Reputation: 3568
I know it's a simple question, but I've got stuck here. How to display html formatting on liferay? I have tried to use outputText or outputLabel, but on the page view, it still display as is. For example (supposed backing.val value is output <b>text</b>
):
<h:outputText value="#{backing.val}" />
--> output <b>text</b>
<p:outputLabel value="#{backing.val}" />
--> output <b>text</b>
I want the text
is bold. How to do that? Thank you very much.
Upvotes: 0
Views: 221
Reputation: 3186
Adding escape="false"
is vulnerable for Cross Site Scripting.
Why don't you use style
or styleClass
instead?
In this case, your output from the bean should be just text
and not <b>text</b>
<h:outputText value="#{backing.val}" style="font-weight:bold;"/>
OR
<h:outputText value="#{backing.val}" styleClass="boldTextClass"/>
.boldTextClass
{
font-weight: bold;
}
Upvotes: 2
Reputation: 20663
Add escape="false"
attribute:
<h:outputText value="#{backing.val}" escape="false"/>
More information can be found here: http://www.jsftoolbox.com/documentation/help/12-TagReference/html/h_outputText.html
Upvotes: 2