In the spring bean configurations, bean attribute called 'scope' defines what kind of object has to created and returned.
There are following types of bean scope in Spring Framework :-
- Singleton (used by default): Singleton scope means a single instance per Spring container; It is not thread-safe.
- Prototype: Prototype means any number of object instances per Spring container.
- Request: Request scope a bean definition to an HTTP request. Only valid in the context of a web-aware Spring ApplicationContext.
- Session: The Session scope is a bean definition to an HTTP session. Only valid in the context of a web-aware Spring ApplicationContext.
- Global-session: The Global-session scope is a bean definition to a global HTTP session. Only valid in the context of a web-aware Spring ApplicationContext.