I get a String from < p:editor>
like this : < b>This is bold text< /b>
.
I want to show <b>This is bold text</b>
in xhtml page. What tag can i use to do that ?
Use an outputText with escape="true"
:
<h:outputText escape="true" value="<b>This is bold</b>"/>
As stated in the answer to this question:
...Facelets implicitly wraps inline [emphasis added] content in a component as represented by
<h:outputText>
So, if you don't use an outputText
tag with the escape
attribute set to true
Facelets will add one for you which will escape the html tags.
Edit: I am completely wrong about the escape
attribute. Please forgive my ignorance as I am still learning as well. According to the documentation the escape
attribute:
Flag indicating that characters that are sensitive in HTML and XML markup must be escaped. This flag is set to "true" by default.
Please see the answer to this OS question for a correct example.
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