Question - How to Define the Scope of a Bean?
Answer -
In order to set Spring Bean's scope, we can use @Scope annotation or “scope” attribute in XML configuration files. Note that there are five supported scopes:
- Singleton
- Prototype
- Request
- Session
- Global-session