AndreaNobili
AndreaNobili

Reputation: 42997

How can I correctly comment the JSTL code into a JSP to correctly exclude it from execution?

I am working on a JSP page.

I have noticed that if I want to exclude that this test is performed:

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

The use of the HTML comments on the <c:if> tag don't works and the test still be performed.

Why? What am I missing? How can I correctly comment this JSTL test to exclude it and avoid that it is performed?

Upvotes: 1

Views: 436

Answers (1)

Zeeshan
Zeeshan

Reputation: 12421

Here is the syntax for JSP comment:

<%-- Comment --%>

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

Upvotes: 2

Related Questions