or directly write static text to an xhtml file ...">

Should I use <h: outputText> to print static text?

Should I use <h:outputText value="static text"/> or directly write static text to an xhtml file to print static text?

Example - with output text:

 <h:outputText value="User Name:"/> <h:outputText value="#{currentUser.name}"/> 

An example is directly:

 User Name: <h:outputText value="#{currentUser.name}"/> 
+4
source share
1 answer

Just write it right on the page without outputText. You can even write el expressions without a tag. Therefore you can write:

 User name: #{currentUser.name} 

To output text using ajax, you need output text (including), visualize it conditionally or want to apply certain styles to the text.

+8
source

Source: https://habr.com/ru/post/1403966/


All Articles