Variables

Variables are named references to data (objects), created by the application or made available implicitly by the EL. Application-specific variables can be created in many ways, for instance using the <jsp:useBean> action. They can also be created by custom actions or be passed to the JSP page by a servlet. Every object that is available in one of the JSP scopes can be used as an EL variable:

<c:out value="${aScopedVariable}" />

Implicit Variables

All information about a request and other data can be accessed through the EL implicit variables:

Variable name

Description

pageScope

A collection of all page scope variables (a java.util.Map).

requestScope

A collection of all request scope variables (a java.util.Map)

sessionScope

A collection of all session scope variables (a java.util.Map)

applicationScope

A collection of all application scope variables (a java.util.Map)

param

A collection of all request parameter values, as a single String value per parameter (a java.util.Map)

paramValues

A collection of all request parameter values, as a String array per parameter (a java.util.Map)

header

A collection of all request header values, as a single String value per header (a java.util.Map)

headerValues

A collection of all request header values, as a String array per header (a java.util.Map)

cookie

A collection of all request cookie values, as a single javax.servlet.http.Cookie value per cookie (a java.util.Map). See Appendix D for a list of properties ...

Get JavaServer Pages, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.