Aliuk Aliuk - 6 months ago 20
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?


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>