[Top] [Prev] [Next] [Bottom]

Output Comment

Generates a comment that is sent to the client in the viewable page source.

JSP Syntax

<!--    comment [ <%= expression %> ] -->

Example 1

<!-- This file displays the user login screen -->

Displays in the page source:

<!-- This file displays the user login screen -->

Example 2

<!-- This page was loaded on
	<%= (new java.util.Date()).toLocaleString() %> -->

Displays in the page source:

<!-- This page was loaded on January 1, 2000 -->

Description

The JSP engine handles an output comment as uninterpreted HTML text, returning the comment in the HTML output sent to the client. You can see the comment by viewing the page source from your Web browser.

An Expression included in a comment is dynamic and is evaluated when the Web browser loads the page (that is, when the user first loads the page or reloads it later). You can use any valid JSP expression.

See Also



[Top] [Prev] [Next] [Bottom]

Copyright © 1999, Sun Microsystems, Inc. All rights reserved.