How to Convert the Expression to String in JSP

JSP Expression Tag

JSP Expression contains an expression valid in the page scripting language. You can sometimes use expressions as attribute values in JSP tags. If an expression has more than one part, the parts are evaluated in left-to-right order as they appear in the tag.

JSP Syntax

<%= expression %>


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


An expression tag 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 text in a JSP file. When you use the Java language for scripting, remember these points:

1. You cannot use a semicolon to end an expression (however, the same expression within scriptlet tags requires the semicolon; see Scriptlet).
2. The expression tag can contain any expression that is valid according to the Java Language Specification.


Related Topic What is Scalar Values Manipulation in Perl Scripting
Date Time functions Mysql
The List of Mysql Date and Time Functions
A to Z Linux Commands quick reference sheet
Javascript Date Object Constructor with Examples

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback