Download View - ITtestpapers.com

Transcript
USING SCOPE OBJECTS
other Web resources. The Java Servlet technology mechanisms that allow a Web
component to invoke other Web resources are described in Invoking Other Web
Resources (page 72).
Using Scope Objects
Collaborating Web components share information via objects maintained as
attributes of four scope objects. These attributes are accessed with the
[get|set]Attribute methods of the class representing the scope. Table 3–3
lists the scope objects.
Table 3–3
Scope Objects
Scope
Object
Class
Accessible From
Web context
javax.servlet.
ServletContext
Web components within a Web context. See
Accessing the Web Context (page 75).
session
javax.servlet.
http.HttpSession
Web components handling a request that belongs to
the session. See Maintaining Client State (page 76).
subtype of
request
page
javax.servlet.
ServletRequest
Web components handling the request.
javax.servlet.
jsp.PageContext
The JSP page that creates the object. See Implicit
Objects (page 92).
55