Contents | Prev | Next


HTML Comment

Generates a comment that is sent to the client.

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

An HTML comment in a JSP file is very similar to any other HTML comment. It documents the file and can be viewed in the page source from your Web browser.

The one difference is that you can use an expression in an HTML comment in a JSP file. The expression is dynamic and is evaluated when the page is loaded or reloaded in the Web browser. You can use any expression that is valid in the page scripting language; for more information, see Expression.

See Also



Contents | Prev | Next

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