Jsp ---- EL expression, jspel
Concept:
Expression Language (EL) is a new function added in JSP 2.0. Using Expression Language, you can easily access the attribute content of a flag (four types of flag spaces are provided in JSP: page (pageContext), request, session, and application, this avoids many scriptlet code. The simple syntax for accessing: $ {attribute name} outputs the attribute content without using the expression language.
<% @ Page contentType = "text/html" pageEncoding = "UTF-8" %>
Use Expression Language to output attribute content
<% @ Page contentType = "text/html" pageEncoding = "GBK" %>
From the above we can see that the EL expression language can easily output attributes, making the code more concise.
If the property does not exist, null is automatically set "".. You can use an expression to output attributes or parameters of a specified range.
Built-in object definition in Expression Language
Attribute range
Attribute of the retrieved range
<% @ Page contentType = "text/html" pageEncoding = "GBK" %>
Call methods of JSP built-in objects
<% @ Page contentType = "text/html" pageEncoding = "GBK" %>
Receiving Request Parameters
<% @ Page contentType = "text/html" pageEncoding = "GBK" %>
Receives a set of parameters using expressions.
<Html>
param_values_demo.jsp
<% @ Page contentType = "text/html" pageEncoding = "GBK" %> By default, the expression outputs attributes in order: Order: page> request> session> application also supports set operations in the expression language, you can easily use expression language to output the content in Collection (sub-interface: List, Set) and Map sets. Set of output Collection Interfaces
<% @ Page contentType = "text/html" pageEncoding = "GBK" import = "java. util. * "%>
Output Map set
When the Map set is output, the VALUE still needs to be found through the KEY
<% @ Page contentType = "text/html" pageEncoding = "GBK" %> <% @ page import = "java. util. * "%>