Scopes

There are four scopes for objects in a JSP application.

Table 8-6: Scopes for objects in a JSP application

Scope

Description

Page

Accessible only in the page in which the object is created. Released when the response is returned or the request forwarded.

Request

Accessible from pages processing the request in which the object is created. Released when the request has been processed.

Session

Accessible from pages processing requests in the same session in which the object is created. Released when the session ends.

Application

Accessible from pages processing requests in the same application in which the object is created. Released when the runtime environment reclaims the ServletContext.