【问题标题】:How can I correctly comment the JSTL code into a JSP to correctly exclude it from execution?如何正确地将 JSTL 代码注释到 JSP 中以正确地将其排除在执行之外?
【发布时间】:2016-04-08 05:14:32
【问题描述】:

我正在处理一个 JSP 页面。

我注意到,如果我想排除执行此测试:

<!--<c:if test="${progetto.twp1009Tipostaprogetto.codTipSta==5}">-->
    SHOW SOME HTML ELEMENTS
<!--</c:if>-->

在标签上使用 HTML cmets 不起作用,仍然进行测试。

为什么?我错过了什么?如何正确注释此 JSTL 测试以排除它并避免它被执行?

Tnx

【问题讨论】:

标签: jsp jstl comments


【解决方案1】:

JSP 注释的语法如下:

<%-- Comment --%>

<%--<c:if test="${progetto.twp1009Tipostaprogetto.codTipSta==5}">--%>
    SHOW SOME HTML ELEMENTS
<%--</c:if>--%>

【讨论】:

    猜你喜欢
    • 2015-07-29
    • 2012-01-29
    • 2020-02-16
    • 2011-02-28
    • 1970-01-01
    • 2014-06-12
    • 1970-01-01
    • 2021-11-06
    • 1970-01-01
    相关资源
    最近更新 更多