JSP Expression Language provides many implicit objects that we can use to get attributes from different scopes and parameter values. Note that these are different from JSP implicit objects and contains only the attributes in given scope. The only common implicit object in JSP EL and JSP page is pageContext object.
Below table provides list of implicit object in JSP EL.
JSP EL Implicit Objects | Type | Description |
---|---|---|
pageScope | Map | A map that contains the attributes set with page scope. |
requestScope | Map | Used to get the attribute value with request scope. |
sessionScope | Map | Used to get the attribute value with session scope. |
applicationScope | Map | Used to get the attributes value from application scope. |
param | Map | Used to get the request parameter value, returns a single value |
paramValues | Map | Used to get the request param values in an array, useful when request parameter contain multiple values. |
header | Map | Used to get request header information. |
headerValues | Map | Used to get header values in an array. |
cookie | Map | Used to get the cookie value in the JSP |
initParam | Map | Used to get the context init params, we can’t use it for servlet init params |
pageContext | pageContext | Same as JSP implicit pageContext object, used to get the request, session references etc. example usage is getting request HTTP Method name. |
No comments:
Post a Comment