JSF display HTML comment

后端 未结 4 701
深忆病人
深忆病人 2021-02-14 04:11

I am using JSF 2.0 and have defined property javax.faces.FACELETS_SKIP_COMMENTS to skip comments in JSF code because there is a lot of other code, deveploping comme

相关标签:
4条回答
  • 2021-02-14 04:31

    This is crude but it does work (under JSF 1.2 anyway not tested in 2)

    <h:outputText value="&lt;!--" escape="false" /> My comment <h:outputText value="--&gt;" escape="false" />
    
    0 讨论(0)
  • 2021-02-14 04:51

    Maybe you could use f:verbatim:

    <f:verbatim>&lt;!--[if lt IE 7]&gt;
        Something just for lower than IE7
    &lt;![endif]--&gt;</f:verbatim>
    
    0 讨论(0)
  • 2021-02-14 04:56

    Use <ui:remove> to remove comments instead of the context parameter.

    0 讨论(0)
  • 2021-02-14 04:56

    Based on @Juan's and @reevesy's ideas is this one:

    <f:verbatim>&lt;!--
        This is a happy HTML comment :)
    --&gt;</f:verbatim>
    

    Which will render:

    <!--
        This is a happy HTML comment :)
    -->
    
    0 讨论(0)
提交回复
热议问题