2008.04.09 摘自 JSF in action 2.4.2 Using implicit variables Page/115
Table 2.6 The JSF EL supports implicit variables for accessing commonly used objects. Most of the
same variables are supported by the JSP 2.0 EL.
| Implicit variable |
Description |
Example |
Supported in JSP 2.0 EL? |
|
applicationScope
|
A Map of application-scoped variables, keyed by name.
|
#{application- Scope.myVariable}
|
Yes
|
|
cookie
|
A Map of cookie values for the current requested, keyed by cookie name.
|
#{cookie.myCookie}
|
Yes
|
|
facesContext
|
The FacesContext instance for the current request.
|
#{facesContext}
|
No
|
|
header
|
A Map of the HTTP header values for the current request, keyed by header name. If there are multiple values for the given header name, only the first is returned.
|
#{header['User-Agent']}
|
Yes
|
|
headerValues
|
A Map of the HTTP header values for the current request, keyed by header name. For each key, an array of Strings is returned (so that all values can be accessed).
|
#{headerValues['Accept- Encoding'][3]}
|
Yes
|
|
initParam
|
A Map of the application initialization parameters, keyed by parameter name. (These are also known as servlet context initialization parameters, and are set in the deployment descriptor).
|
#{initParam.adminEmail}
|
Yes
|
|
param
|
A Map of the request parameters, keyed by header name. If there are multiple values for the given parameter name, only the first is returned.
|
#{param.address}
|
Yes
|
|
paramValues
|
A Map of the request parameters, keyed by header name. For each key, an array of Strings is returned (so that all values can be accessed).
|
#{param.address[2]}
|
Yes
|
|
requestScope
|
A Map of request scoped variables, keyed by name.
|
#{requestScope.user- Preferences}
|
Yes
|
|
sessionScope
|
A Map of session scoped variables, keyed by name.
|
#{sessionScope['user']}
|
Yes
|
|
view
|
The current view.
|
#{view.locale}
|
No
|
发表于 @ 2008年04月09日 17:54:00|评论(loading...)|编辑