May 2001
Intermediate to advanced
1088 pages
30h 13m
English
Comments are generally used for two things: making notations about the code, and removing sections of code. There are at least four different ways to add comments to a Java server page, each with its own advantages and disadvantages. If your JSP is generating HTML, you can use HTML comments, which use the <!-- and --> tags, like this:
<!-- This is an HTML comment -->
In general, only use HTML comments in a JSP if you want the comment to be visible on the browser. Most of the time, you don't care if the user can see any of your comments, so the HTML comments are usually not used in a Java Server Page. You might find yourself using the HTML comments if you have a large section of HTML in your JSP and you want to remove a section ...
Read now
Unlock full access