f:verbatim tag stops working when inside a dataTable

后端 未结 1 550
梦毁少年i
梦毁少年i 2021-01-01 07:38

I posted this to the PrimeFaces user forum but I think they are too busy to look into it, so I thought I would try here.

I have server-side string that has markup in

相关标签:
1条回答
  • 2021-01-01 08:07

    The <f:verbatim> tag is intented to hold plain text/HTML, not JSF components nor EL expressions. The tag is a leftover from JSF 1.0/1.1 ages when it was not possible to inline plain text/HTML between JSF components. The tag is deprecated in JSF2. You do not need it anymore.

    Your concrete functional requirement is thus displaying some HTML string from a managed bean unescaped. For that you should use <h:outputText> with escape="false".

    <h:outputText value="#{daBean.markedUpString}" escape="false" />
    

    See also:

    • Getters inside f:verbatim called before form submission
    • JSF/Facelets: why is it not a good idea to mix JSF/Facelets with HTML tags?
    • What are the main disadvantages of Java Server Faces 2.0?
    0 讨论(0)
提交回复
热议问题