Scope describes how the spring container creates a new instance of the bean, implemented by @scope annotations:
The spring container initially provided the scope type of two beans: Singleton and prototype, but after release 2.0, another three scope types were introduced: request, session, and global session. These three types can only be used in Web applications.
①singleton: A spring container has only one bean instance, which is the default configuration for spring. @Scope ("Singleton")
②prototype: Every time a new instance of a bean is called
③request:web project, create a new bean instance for each HTTP request
④session:web project, create a new bean instance for each HTTP session
⑤globalsession: This is intended to be useful in portal applications, creating a new bean instance for each global HTTP session
Another scope in spring batch is the use of @stepscope in batch processing.