Spring Bean scope in JSP: springbean
Scope of Spring Bean in JSP
The Bean element has a scope attribute to define the Bean scope. The attribute has the following values:
1> singleton:
In Singleton mode, in the entire spring IOC container, only one instance is generated for beans in the singleton mode scope. Generally, the default Bean scope of Spring containers is singleton.
2> prototype:
Opposite to singleton, a new Bean instance is generated every time the Bean under this scope is obtained through the getBean () method of the container.
3> request:
For the same Http request, only one instance is generated for the Bean under the request scope. This scope is valid only when Spring containers are used in Web applications.
4> session:
For the same Http session, only one instance is generated for beans in the session scope. This scope is only valid when Spring containers are used in Web applications.
5> global session:
Each global Http Session corresponds to a Bean instance.
Thank you for reading this article. I hope it will help you. Thank you for your support for this site!