Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jsf control that format text with html tags [duplicate]

Tags:

jsf

Good morning all.

Is there any jsf control that escapes the html tags?

Imagine that i have the following string in resources:

text.String=lalala<br/>lelele

and i want to print it on Xhtml file with a simple control like:

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

how do i get the result formatted with the html <br/> tag? Result should be:

lalala
lelele

instead of:
lalala<br/>lelele

Thanks

like image 975
João Madureira Pires Avatar asked Dec 29 '22 12:12

João Madureira Pires


1 Answers

the outputText control has an 'escape' property which controls that behaviour. See here (outputText reference).

So basically:

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

should do the job.

like image 148
KB22 Avatar answered Jan 18 '23 07:01

KB22