The concept of El expressions

1 What is EL
Expression Language (EL), which JSP setters can use to access application data, EL can easily write JSP pages that do not contain scripts or Java code.
2 Syntax
  a, ${expression} The type of the result is forced to String
If an EL expression is used in an attribute of a custom tag, the expression will be evaluated and the resulting string will be forced to the desired type of the attribute
<my:tag somAttribute="${expression}"/>
  b, [] and . operators
If there is a property in the result object of an EL expression, it can be used to access it.
  c, implicit object of EL
EL provides its own set of implicit objects that can help you access various objects.
Used to get the value of a context parameter; for example, to get the password of the context parameter, you need to use
Used to get a request parameter. This object represents a Map containing all request parameters.
To get userName ${param.userName}
Multiple values ​​for a request parameter can be obtained. This object represents a Map containing all request parameter names as keys. The value of each key is an array of strings,
which contains all the values ​​for the specified parameter name. If the parameter has only one value, an array with only one element is also returned.
Represents a Map containing all request headers. To get a header value, you need to use that header as a key.
Represents a Map containing all request headers and keyed by the header name, the returned Map returns an array of strings.
A map representing all cookies in the current HttpServletRequest
Get the value of an application-scoped variable. ${applicationScope.myVar.value}

3. Summary
EL can help you write shorter and more efficient JSP pages, as well as help you write scriptless pages.

Guess you like