I need to output the html text, which is stored in database. The text is generated by the rich editor, so contains bad-formed html (non-closed tags like <br>
). So I have the problem how to print it on the page.
If I use:
#{document.content}
It prints the escaped html document, and all tags are displayed on the page (the code itself contains "& lt;" instead of <)
The visible solution - to use h:outputText with escape="false:
<h:outputText value="#{document.content}" escape="false" />
But it prints the html only until it is well-xml-formed: the text is stopped on the first <br>
tag. Seems, JSF parses the content of the document.content and stops when cannot do it. I don't really need JSF to parse the content, simply output!
The following code didn't help either:
<h:outputText value="lt![CDATA[#{document.content}]]gt" escape="false" />