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

1 Answer

0 votes
by (2k points)

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.

Share:- Whatsapp Facebook Facebook


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

Categories

...