Values of the scope Attribute
page
Default value. Bean object should be placed in the
PageContext object for the duration of the current
request. Lets methods in same servlet access bean
application
Bean will be stored in ServletContext (available through
the application variable or by call to getServletContext()).
ServletContext is shared by all servlets in the same Web
application (or all servlets on server if no explicit Web
applications are defined).
71
JSP
www.corewebprogramming.com
Values of the scope Attribute
session
Bean will be stored in the HttpSession object associated
with the current request, where it can be accessed from
regular servlet code with getAttribute and setAttribute, as
with normal session objects.
request
Bean object should be placed in the ServletRequest object
for the duration of the current request, where it is
available by means of getAttribute
72
JSP
www.corewebprogramming.com
36