Spring ioc注解原理

annotation:注解 @Configuration  //告诉Spring这是一个配置类 @Bean                 //给容器中配置一个Bean 类型为返回值类型,id默认是方法名 也可以指定value值 @Autowired和@Resource是用来修饰字段、构造函数或者设置方法,并做注入的。 //包扫描,只要标注了@controller,@service,@reposi
相关文章
相关标签/搜索