Datasheet

Patrick c01.tex V3 - 09/18/2009 12:15pm Page 18
Chapter 1: Building Web Applications in WebLogic
Table 1-4: JSP Implicit Objects
Identifier Description
pageScope Map
containing page-scoped attributes
requestScope Map
containing request-scoped attributes
sessionScope Map
containing session-scoped attributes
applicationScope Map
containing application-scoped attributes
param Map
containing the primary values of the request parameters
paramValues Map
containing all values of the request parameters as
String
arrays
header Map
containing the primary values of the request headers
headerValues Map
containing all values of the request headers as
String
arrays
cookie Map
containing all cookies accompanying the request
initParam Map
containing the context initialization parameters of the
web application
pageContext
The
PageContext
instance for the page, providing access to
all JSP implicit objects
Although the Expression Language syntax is very powerful, it can be a bit confusing at times. Find a
good reference on JSTL, including the EL, and refer to it often until you get the hang of it. You’ll find that
95% or more of your custom tag invocations will use the EL syntax for one or more of the attributes in
the tag, because it is the only recommended way to pass dynamic data into the tags.
Above all, resist the temptation to use the old-style scriptlet code in your JSP pages. With a little exper-
imentation, you’ll find there is very little you can do in scriptlet code that you cannot accomplish with
JSTL and the Expression Language syntax.
Best Practice
Master the Expression Language (EL) syntax and use it extensively in the JSTL tags
within your JSP pages. Use expressions in a clear and consistent manner to improve
readability, choosing appropriate operators and constructs. Avoid JSP scriptlet code if
at all possible.
18