June 2018
Intermediate to advanced
408 pages
11h 23m
English
In the previous section, we saw the two bean configuration techniques, Java-based and XML-based. Both the techniques inject dependency explicitly. In Java-based, we use the @Bean annotated method in the AppConfig Java file whereas, in XML-based, we use the <bean> element tag in the XML configuration file. Annotation-based configuration is another way of creating a bean, where we can move the bean configuration into the component class itself using annotations on the relevant class, method, or field declaration. Here, we will look at how we can configure a bean through annotation, and the different annotations available in Spring Framework.
Annotation-based configuration is turned off by default in Spring, so ...
Read now
Unlock full access