Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF: How to let #{...} expansion not be escaped?

I have a custom EL function (defined in myfunctions.taglib.xml) which returns a chunk of HTML, I want to copy it verbatim to the output,

<f:verbatim>
    #{mylib:generateHtml()}
</f:verbatim>

however, the expansion of #{...} is always escaped. How to make it not be escaped?

like image 274
Xiè Jìléi Avatar asked Feb 24 '23 13:02

Xiè Jìléi


1 Answers

Use <h:outputText escape="false" />. The <f:verbatim> serves an entirely different purpose specifically for JSP views and is dangerous on Facelets and is deprecated in JSF 2.0.

<h:outputText value="#{bean.html}" escape="false" />
like image 171
BalusC Avatar answered Mar 06 '23 02:03

BalusC