adspace


Different spring bean scope.

Answer Posted / Dawer Husain

Spring Framework supports several bean scopes:
1. Singleton (default): A single instance of a bean is created when the container starts, and it's reused throughout the application lifecycle.
2. Prototype: A new instance is created every time a bean is requested.
3. Request: A single instance per servlet request.
4. Session: A single instance per HTTP session.
5. Application: A single instance per SpringApplication context.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between @controller and @restcontroller in spring?

556


What is lazy class?

490


How can you inject java collection in spring?

518