Implicit Objects

JSPs provide you with a set of implicit objects that you can use to build your applications. These objects do not have to declared or initialized . Table 14-1 describes nine implicit objects/ variables .

Table 14-1: Implicit JSP Objects/Variables

Object Name

Description

application

Provides access to the application's environment.

config

Provides access to the servlet configuration for JSPs.

exception

Only available if a JSP is marked as a JSP error page. This is covered in more detail in the Error Pages section of this chapter.

Out

Provides access to the JSP's output stream.

page

Provides access to the JSP's implementation object that is created when the page is translated.

pageContext

Provides access to attributes stored in the page scope.

request

Provides access to attributes and parameters stored in the request scope.

response

Provides access to the response object.

session

Provides access to attributes stored in the session scope.

Implicit objects can be used in scriptlets to access or update values and access methods provided by the classes that they represent. The following example shows how to use the request and session implicit objects.

 <% session.setAttribute("username", request.getParameter("username")); %> 


Oracle Application Server 10g Web Development
Oracle Application Server 10g Web Development (Oracle Press)
ISBN: 0072255110
EAN: 2147483647
Year: 2004
Pages: 192

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