How to define the scope of a bean?



How to define the scope of a bean?..

Answer / Akhand Pratap Kaushal

In Spring Framework, you can define the scope of a bean using the scope attribute in the configuration file or annotation. The possible scopes are singleton (by default), prototype, request, session, application, and webSocket.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Spring Framework Interview Questions

What are spring jdbc templates used for?

1 Answers  


What are spring components?

1 Answers  


What is jpa in spring?

1 Answers  


What is difference between spring framework and spring boot? : Spring Boot

1 Answers  


What are the types of advice?

1 Answers  


Where is spring aop used?

1 Answers  


What is aop proxy?

1 Answers  


What is session scope in spring?

1 Answers  


What is spring language?

1 Answers  


What is difference between @pathparam and @pathvariable?

1 Answers  


What is mvc spring?

1 Answers  


What is the difference between responsebody and responseentity?

1 Answers  


Categories