首页 > 技术文章 > spring Boot加载bean

javabg 2019-04-14 12:02 原文

1、SpringBoot中加载bean,可以使用注解@compenent直接加载到applicationContext容器中

2、在直接类@Configuration中,手动注册bean,如:

 

推荐阅读