Contents | Prev | Next


Expression

Contains an expression valid in the scripting language used in the JSP page.

Syntax

<%= expression %>

Examples

The map file has <font color="blue"><%= map.size() %></font> entries.
Good guess, but nope. Try <b><%= numguess.getHint() %></b>.

Description

An expression element contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file. Because the value of an expression is converted to a String, you can use an expression within a line of text, whether or not it is tagged with HTML, in a JSP file.

When you write expressions in a JSP file, remember these points:

You can sometimes use expressions as attribute values in JSP elements (see the JavaServer Pages Syntax Card). An expression can be complex and composed of more than one part or expression. The parts of an expression are evaluated in left-to-right order.

See Also



Contents | Prev | Next

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