How is a bean added to a spring application?
Answer / Monika Sirohi
You can add a bean to a Spring Application by defining its configuration in an XML file or using annotations. If you're using XML, the bean definition is included in the 'beans' element of the Spring configuration file. If you're using annotations, the bean class must be annotated with @Component, and the bean can be registered automatically if the component scan is enabled.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the different modules in spring framework?
What is proxy in spring aop?
What is jdbctemplate in spring? And how to use it?
Is spring data jpa an orm?
What is the basic concept of spring?
What is spring boot starter jdbc? : Spring Boot
Which is good to use – constructor or setter-based dependency?
What is mockito junit?
What is service layer in spring mvc?
How many modules are there in spring framework and what are they?
What is stateful bean in spring?
What is the ioc in spring?