SpringBoot spring bean注册方法
把一个class声明成一个或多个bean,并且能够被spring容器处理的方法:1,使用 AnnotationConfigApplicationContextAnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(AppConfig.class); ctx.refresh(); MyBean myBean = ctx.getBean(MyBean.class); // use myBean ...2,使用Spring XML<beans> <context:annotation-config/> <bean c…