JSP syntax


Block comments start with <%-- and end with --%>

If you use html style comments, or javascript comments, the JSP engine will still evaluate the commented portions of your code. In general we use JSP style comments where possible because:

  • It cuts down on the total size of the generated HTML file. The comments will still be viewable using View -> Source from your browser if you use HTML style comments.

  • Exposure of inadvertent comments in reduced.

  • It reduces load on the server as the portion of commented code is not evaluated.

Published: Thursday, 3 November 2005