JSP Syntax (4)

Source: Internet
Author: User
Tags expression
js| syntax expressions

Contains an expression that conforms to the JSP syntax



JSP syntax

<%= expression%>

Example

<font color= "Blue" ><%= map.size ()%></font>

<b><%= numguess.gethint ()%></b>.

Describe

An expression element represents an expression that is defined in a scripting language, automatically converted to a string after it is run, and then inserted into the location of the JSP file to display the expression. Because the value of this expression has been converted to a string, you can insert the expression in one line of text (in the same way as an ASP).



When you use an expression in your JSP, keep the following points in mind:



You cannot use a semicolon (";") as the terminator of an expression. But the same expression used in scriptlet needs to end with a semicolon! View Scriptlet

This expression element can include any expression that is valid in the Java Language specification.

Sometimes an expression can also be a property value of another JSP element. An expression can become complex, and it may consist of one or more expressions, the order of which is left to right.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.