• Register

Share:- Whatsapp Facebook Facebook

------------------------------------- Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

0 votes
22 views
What are the different types of bean scope in Spring framework?
in Spring by

1 Answer

0 votes

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 :-

  1. Singleton (used by default): Singleton scope means a single instance per Spring container; It is not thread-safe.
  2. Prototype: Prototype means any number of object instances per Spring container.
  3. Request: Request scope a bean definition to an HTTP request. Only valid in the context of a web-aware Spring ApplicationContext.
  4. Session: The Session scope is a bean definition to an HTTP session. Only valid in the context of a web-aware Spring ApplicationContext.
  5. 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.
by (1.8k points)
...