|
There are four scope which an object can have in a JSP page.- Page Scope: Objects with page scope are accessible only within the page. Data is only valid for the current response. Once the response is sent back to the browser after that data is no more valid. Even if request is passed from one page to other the data is lost.
- Request Scope: Objects with request scope are accessible from pages processing the same request in which they were created. Once the container has processed the request data is invalid. Even if the request is forwarded to another page, the data is still available.
- Session Scope: Objects with session scope are accessible in same session. Session is the time users spend using the application, which ends when they close their browser or when they go another website.
- Application Scope:
Application scope objects are basically global object and accessible to all JSP pages which lie in the same application. This creates a global object that's available to all pages. Application scope variables are typically created and populated when an application starts and then used as read only for the rest of the application.
|