JSP.2.8 Implicit Objects


When you author JSP pages, you have access to certain implicit objects that are always available for use within scriptlets and expressions, without being declared first. All scripting languages are required to provide access to these objects.

Each implicit object has a class or interface type defined in a core Java technology or Java servlet API package, as shown in Table JSP.2-4.

Table JSP.2-4. Implicit Objects Available in JSP Pages

Implicit Variable

Of Type

What It Represents

Scope

request

protocol dependent subtype of: javax.servlet.ServletRequest e.g.: javax.servlet.HttpServletRequest

The request triggering the service invocation.

request

response

protocol dependent subtype of: javax.servlet.ServletResponse e.g.: javax.servlet.HttpServletResponse

The response to the request.

page

pageContext

javax.servlet.jsp.PageContext

The page context for this JSP page.

page

session

javax.servlet.http.HttpSession

The session object created for the requesting client (if any). This variable is valid only for Http protocols.

session

application

javax.servlet.ServletContext

The servlet context obtained from the servlet configuration object (as in the call getServletConfig().getContext() )

application

out

javax.servlet.jsp.JspWriter

An object that writes into the output stream.

page

config

javax.servlet.ServletConfig

The ServletConfig for this JSP page.

page

page

java.lang.Object

The instance of this page's implementation class processing the current request. [a]

page

[a] When the scripting language is "java" then "page" is a synonym for "this" in the body of the page.

In addition, in an error page, you can access the exception implicit object, described in Table JSP.2-5.

Table JSP.2-5. Implicit Objects Available in Error Pages

Implicit Variable

Of Type

What It Represents

scope

exception

java.lang.Throwable

The uncaught Throwable that resulted in the error page being invoked.

page

Object names with prefixes jsp , _jsp , jspx , and _jspx , in any combination of uppercase and lowercase, are reserved by the JSP specification.

See Section JSP.5.8.1 for some non-normative conventions for the introduction of new implicit objects.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net