implicit objects in JSP
There are eight implicit objects variables.
The variables are request, response,
out, session, application,
config, pageContext, and
page.
request
This is the HttpServletRequest associated with the request,
and the request parameters
(via getParameter), the request type
(GET, POST, HEAD, etc.),
and the incoming HTTP headers (cookies, Referer, etc.).
response
This is the HttpServletResponse associated with the
response to the client.
out
This is the PrintWriter used to send output to the client.
This is a buffered version
of PrintWriter called JspWriter.
Note that you can adjust the buffer size, or even turn buffering off,
through use of the buffer attribute of the
page directive.
session
This is the HttpSession object associated with the request.
Recall that sessions are created automatically, so this
variable is bound even if there was no incoming session
reference. The one exception is if you use the
session attribute of the
page directive to turn sessions off, in which
case attempts to reference the session variable
cause errors at the time the JSP page is translated into
a servlet.
application
This is the ServletContext as obtained via
getServletConfig().getContext().
config
This is the ServletConfig object for this page.
pageContext
JSP introduced a new class called PageContext
to encapsulate use of server-specific
features like higher performance JspWriters. The idea
is that, if you access them through this class rather than
directly, your code will still run on "regular"
servlet/JSP engines.
page
This is simply a synonym for this, and is not
very useful in Java. It was created as a placeholder for
the time when the scripting language could be something
other than Java.
|