Nearby lessons

13 of 30

JSP - EL Implicit Objects

📌 What You Will Learn
  • Know all 11 EL implicit objects
  • Use param, header, cookie, initParam objects
  • Use scope objects to access attributes in specific scopes

EL Implicit Objects give you access to request parameters, headers, cookies, scope attributes, and the page context — all through simple map-like syntax in EL expressions.

All 11 EL Implicit Objects

ObjectTypePurpose
pageScopeMapAttributes in page scope
requestScopeMapAttributes in request scope
sessionScopeMapAttributes in session scope
applicationScopeMapAttributes in application scope
paramMapRequest parameters (single values)
paramValuesMapRequest parameters (String[] arrays)
headerMapRequest headers (single values)
headerValuesMapRequest headers (String[] arrays)
cookieMapCookies associated with the request
initParamMapContext initialization parameters from web.xml
pageContextPageContextAccess all JSP implicit objects (the only non-Map)

Scope Objects

Use scope objects to retrieve attributes from a specific scope:

Example02
Loading editor…

Scope Search Order

When you write ${x} without a scope prefix, the container searches in order:

  1. Page scope
  2. Request scope
  3. Session scope
  4. Application scope

This is exactly the same as pageContext.findAttribute("x").

Example03
Loading editor…

param and paramValues

ObjectEquivalent Servlet MethodReturns
paramrequest.getParameter()Single String value
paramValuesrequest.getParameterValues()String[] array
Example04
Loading editor…

header and headerValues

Same as param/paramValues but for request headers:

Example05
Loading editor…

cookie

Access cookies from the request:

Example06
Loading editor…

initParam

Access context parameters declared in web.xml:

Example07
Loading editor…

pageContext — Accessing JSP Objects

pageContext is the only non-Map EL implicit object. Use it to access JSP implicit objects:

Example08
Loading editor…
📝 Key Takeaways
  • EL has 11 implicit objects — most are Maps
  • pageContext is the only non-Map EL implicit object
  • EL handles null and ArrayIndexOutOfBoundsException gracefully

🧠 Test Your Knowledge

3 Questions
Progress: 0 / 3

Finished this lesson?

Mark it as complete to track your progress and see technology completion stats.