Tutorial
Menus

JSP - JSP Tutorial

JSP Comments and Character Quoting Conventions

Rating: 5.0/5 (2 votes cast)

Level   : Beginners
Author : Arunkumar S
Download Source : Not Avaliable

JSP Comments and Character Quoting Conventions

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 you really want "<%".
%\>
Used in scripting elements where you 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.

1 | 

Discussion about this tutorial

  Start a new Discussion | Read All Discussion
Subject RepliesLast Post
Javaorigin.com contact@javaorigin.com