Aliuk Aliuk - 1 year ago 64
HTML Question

Interpreting EL expression containing HTML in JSF page

I am trying to use Froala Editor, however I have a problem when trying to display something I have saved before (

The problem is that, having

with the value

  • if I put in my facelets page
    <div class="fr-view">#{article.body}</div>
    I see on screen the text
    (which is incorrect)

  • however if I put in my facelets page
    <div class="fr-view"><p>aaaa</p></div>
    I see
    (which is the correct text)

Any idea of why is this happening?

Answer Source

You need to tell JSF EL not to escape Bean's field value using <h:outputText> tag.

<div class="fr-view"><h:outputText value="#{article.body}" escape="false"/></div>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download