Jsf control formatting text with html tags

Good morning.

Is there any jsf control that speeds up html tags?

Imagine I have the following line in resources:

text.String=lalala<br/>lelele 

and I want to print it in an Xhtml file using a simple control, for example:

 <h:outputText value="#{messages['text.String']}" /> 

how to get result formatted with html tag <br/> ? The result should be:

 lalala lelele 

instead:
lalala<br/>lelele

thanks

+4
source share
1 answer

The outputText control has an escape property that controls this behavior. See here (link outputText).

So basically:

 <h:outputText escape="false" value="#{messages['text.String']}" /> 

must do the job.

+10
source

All Articles