开发者

How to ignore invalid XML in JSF?

Is it possible to ignore invalid xml-syntax in jsf-files?

I'm writing my own components is jsf 2 and want to create a dynamic table, so i want to render tr- and td-tags conditional. I've tried <h:panelGroup rendered="#{someCondition}"><tr></h:panelGroup> (same with </tr>) and <c:if test="#{someCondition}"><tr></c:if> (same with </tr>) though开发者_如何学JAVA its bad to mix jstl with jsf.

I am getting a javax.faces.view.facelets.FaceletException: Error Parsing [...] The element type "tr" must be terminated by the matching end-tag "</tr>".

Anybody knows how to ignore the invalid xml oder how solve this problem in any other way?


it's a dirty hack but use:

<h:outputText escape="false" value="#{bean.row}" />

in your page, and

public String getRow() {
    return condition ? "" : "<tr>";
}

in your Bean. Same with </tr>.


There is no way to do it. You can set DISABLE_FACELET_JSF_VIEWHANDLER - true in web.xml and problem get away, but on the other hand this downgrade jsf version to 1.2.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜