开发者

Jsf control that format text with html tags [duplicate]

This question already has an answer here: Component to inject and interpret String with HTML code into JSF page (1 answer) 开发者_StackOverflow社区 Closed 6 years ago.

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜