EL contains 11 implicit objects.The power of EL is just because of these implicit objects only.

The following is the list of EL implicit objects.

  1. pageScope
  2. requestScope
  3. sessionScope
  4. applicationScope
  5. param
  6. paramValues
  7. header
  8. headerValues
  9. cookie //To access cookie associated with the request
  10. initParam //To access context initialization parameter(but not servlet initialization parameters)
  11. pageContext //To bring all jsp implicit objects into EL.

pageScope,requestScope,sessionScope and applicationScope

By using these implicit objects, we can retrieve the attributes of a particular scope.

pageScope–>pageContext.getAttribute()
requestScope–>request.getAttribute()
sessionScope–>session.getAttribute()
applicationScope–>application.getAttribute()

Example:

  1. To access the value of session scoped attribute x.
    ${sessionScope.x}
  2. ${requestScope.x}
    It prints the value of request scoped attribute x.In request scope ,if there is no such type of attribute then we will get blank space.
  3. ${x}
    JSP container first checks in pageScope for attribute x if it is available it prints the value, if it is not available then jsp engine searches in request scope followed by session and application scope.
    It is exactly same as pageContext.findAttribute() method