Comments and Character Quoting Convention
 
Comments and Character Quoting
 
There are a small number of special constructs you can use in various cases to insert comments or characters that would otherwise be treated specially.
 
Here's a summary:
 
Syntax Purpose
<%--
comment
--%>
A JSP comment. Ignored by JSP-to-scriptlet translator. Any embedded JSP scripting elements, directives, or actions are ignored.
<!--
comment
-->
An HTML comment. Passed through to resultant HTML. Any embedded JSP scripting elements, directives, or actions are executed normally.
<\% Used in template text (static HTML) where we really want "<%".
%\> Used in scripting elements where we really want "%>".
\' A single quote in an attribute that uses single quotes. Remember, however, that you can use either single or double quotes, and the other type of quote will then be a regular character.
\" A double quote in an attribute that uses double quotes. Remember, however, that you can use either single or double quotes, and the other type of quote will then be a regular character.
%\> %> in an attribute.
<\% <% in an attribute.