Skip to main content

Implicit objects in JSP page

By default page, request, session and application objects are available to JSP pages. So you can access then using EL syntax.
And following table shows IMPLICIT objects available to EL.
       Implicit object            Description
1.     pageScope        Scoped variables from page scope
2.     requestScope     Scoped variables from request scope
3.     sessionScope     Scoped variables from session scope
4.     applicationScope Scoped variables from application scope
5.     param            Request parameters as strings
6.     paramValues      Request parameters as collections of strings
7.     header           HTTP request headers as strings
8.     headerValues     HTTP request headers as collections of strings
9.     initParam        Context-initialization parameters
10.    cookie           Cookie values
11.    pageContext      The JSP PageContext object for the current page
So session and sessionScope are same but differs in context they are used.More specifically session is object and sessionScope is map (key, value) of Attribute and its value.
  • If you say ${session.sessionAttr} it refers to session object available to JSP page.
  • If you say ${sessionScope.sessionAttr} it refers to IMPLICIT session object available to EL.
  • Or if you just say {attrName} it will search attrName in all scope from page to application scope.

Comments