Java配置是Spring4.x推荐的配置方式,可以完全替代xml配置;
Java配置也是Spring Boot推荐的配置方式。
Java配置不需要@Service声明Bean。
也不需要@Autowired注入Bean。
只需要通过@Configuration和@Bean来实现。
本篇只是演示最简单的Java配置,本【Spring】系列博客会一直更新。
要一直学下去的,可以关注我博客。
对于类的说明,我一般是写在代码注释中。
项目链接-具体的包;
<a href="https://github.com/chenhaoxiang/Java/tree/master/springBoot/src/main/java/cn/hncu/p1_3_2">https://github.com/chenhaoxiang/Java/tree/master/springBoot/src/main/java/cn/hncu/p1_3_2</a>