Bean's scope of action:(emphasis)
The sping bean tag has a property named Scope, which is used to set the scope of the action.
scope Type values:Singleton, prototype, request, session, globalsession each of these 5 types is described below
Singleton: Singleton mode, Spring uses singleton mode by default and is the most commonly used type in development. That is, the load bean configuration file can only generate one instance of the class and will only be new once.
Prototype: Multiple cases are used once and will be new once. Because there are many objects, they are not destroyed.
Request: Applied in a Web project, Spring creates this class and then saves the class in the request scope.
Session: Applied in a Web project, Spring creates this class and then saves the class in the session scope.
Globalsession: Applied in a Web project, it must be used in a portlet environment. That is, after the data is stored in the system, there is no need to re-login under its subsystem.
Eg: QQ after the login to click on the QQ space icon, into the QQ space is not required in the QQ login.
It is not normally used.
The most used in the actual development is singleton and prototype, only in the integration of STRUCTS2 will use prototype.
Init-method the properties of the tag initialization in the Bean label, Destory-method is the property that destroys the instance.
Note: Instances can be destroyed in singleton mode only, and multi-case mode is not supported.
The configuration of the spring Bean's scope