Comment details of JSP pages

Business scenario: backstage pass by reference, jstl label Control whether a tab, but now want to get rid of Judgment, directly to the display tab

Such comments directly in the sublime, then refresh, could not find the label display, the other is normal

<!--<c:if test="${actionFlag != 'layer'}">-->
            <li >
                    <a href="javascript:delayPrint()">
                    <i class="fa fa-fw fa-check-square-o"></i>打印</a>
            </li>
<!--</c:if>-->

After communication and colleagues, found to be caused by the comment,

  • <%-- --%>Is a server-side comments in the code, it will be annotated on the server, the browser console is not visible

  • <!-- -->Client commented code, load time, and then will either be resolved through the server, the browser console is visible;

So the addition of jstl label method certainly can not use client comments, or comments can not afford to be effective, these small details still have to pay attention

Therefore, the above code should be changed as follows:

<%--<c:if test="${actionFlag != 'layer'}">--%>
            <li >
                    <a href="javascript:delayPrint()">
                    <i class="fa fa-fw fa-check-square-o"></i>打印</a>
            </li>
<%--</c:if>--%>

Guess you like

Origin www.cnblogs.com/mzq123/p/11402717.html