I have what it seems to be a very trivial question for you jsf expert out there... I'm working in a JSF 2.0 application. Said that I have managed bean with a property containing an html portion to display to the user, which faces control should I use to emit that html directly on the page, without encoding it?
1 Answer
Did you try that:
<h:outputText value="#{myBean.myProperty}" escape="false"/>
By default, escape attribute is set to true in order to escape the HTML / XML characters.
2 Comments
themarcuz
I found out also that using <f:verbatim>#{myBean.myProperty}</f:verbatim> do the job. What's the best way? Any problem with one of the 2 solutions?
BalusC
<f:verbatim> had a special purpose in JSF 1.x which is not necessary anymore in JSF 2.x and is been deprecated since JSF 2.1. Don't use it.