0 votes
in Spring by

What is Bean wiring and @Autowired annotation?

1 Answer

0 votes
by

The process of injection spring bean dependencies while initializing it called Spring Bean Wiring.

Usually, it’s best practice to do the explicit wiring of all the bean dependencies, but the spring framework also supports auto-wiring. We can use @Autowired annotation with fields or methods for autowiring byType. For this annotation to work, we also need to enable annotation-based configuration in spring bean configuration file. This can be done by context:annotation-config element.

Related questions

0 votes
asked Apr 4, 2021 in Spring by Robindeniel
0 votes
asked Jul 27, 2020 in Spring by Robindeniel
...