Should I use <h:outputText value="static text"/> or directly write static text into the xhtml file to print text that is static?
Example – with output text:
<h:outputText value="User Name:"/>
<h:outputText value="#{currentUser.name}"/>
Example – directly:
User Name:
<h:outputText value="#{currentUser.name}"/>
Just write it directly into the page without the outputText. You even can write el expressions without a tag. So you could write:
The outputText is needed (among others) if you want to change the text with ajax, render it conditionally or if you want to apply certain styles to the text.