To share Beans, we use scope attribute in
jsp:UseBean. This attribute can take any of the following four values:
Page : Placed in page context and has page level access.
Application : Shared by all servlets/JSPs in same application/servlet engine.
Session : Stored in HTTPSession.
Request : Placed in ServletRequest object.
Can someone explain me the difference between all these scopes by an example. May be say,
2 applications are running in a
Tomcat Server.
The pages of first application are App1P1.jsp and App1p2.jsp.
The pages of second application are App2p1.jsp and App2p2.jsp.
===
Is it like this?
Page - available for all transactions within the entire JSP page.
Application - For all
servlets of same application (or) Common to all applications, if no explicit application is defined. (how do you define an application explicitly?)
Session - Available to all transactions that happen in the same browser window.
Request - Only for that request.
Can anyone clear my doubt. Thanks in advance.
_Mani