How to display a line break with outputText?

That’s indeed not valid since Facelets because it’s syntactically invalid in XML. You’d need to manually escape the XML special characters like <, > and so on.

<h:outputText value="&lt;br/&gt;" escape="false" />

You can however just emit the <br/> in template text without the need for a <h:outputText>.

<br/>

To render it conditionally, wrap it in for example a <ui:fragment>.

<ui:fragment rendered="#{bean.rendered}"><br /></ui:fragment>

A <h:panelGroup> is also valid as it doesn’t emit anything to the HTML anyway.

<h:panelGroup rendered="#{bean.rendered}"><br /></h:panelGroup>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)