I wish to add ul tag to my jsf in some cases. My codes like:
<c:if test="${level ne 1}" ><ul></c:if>
<li>..</li>
<li>..</li>
<li>..</li>
<c:if test="${level ne 1}" ></ul></c:if>
When I was using jsf 1.2, it works well. But after I change to jsf 2.0, it reads like
"<ul>"
<li>..</li>
<li>..</li>
<li>..</li>
"</ul>"
How can I fix it? Thanks so much!!
You seem to have replaced legacy JSP by Facelets as well (well done!). This behaviour is specific to Facelets. It implicitly HTML-escapes all the template text as part of builtin XSS attack prevention.
Use
<h:outputText escape="false">instead.You’d better use its
renderedattribute instead of those ugly JSTL tags by the way.Unrelated to the concrete problem, for the concrete functional requirement, you may find OmniFaces
<o:tree>component useful.