Abbey Workshop | ||||||||||
Comments are a very simple concept in Java Server Page. To make a comment, simply enclose text in a <-- --> pair. Any text contained in these tags are commented out, and do not appear in the HTML page created by the JSP. For example:
<%-- This is a comment --%>
One of the better uses of comments is for troubleshooting. You can use JSP comments to hide specific pieces of code. You can then test the code without a particular block misssing.
In the example below, one piece of code that prints a message is commented out. Run the example from the link below. You will see that none of the comments appear in the HTML document.
Download source for: jspComment.jsp
Copyright © Abbey Workshop 2006