1、常用IOC注解按照作用分类
@Component(value=" ")
@Component衍生出来的三个注解 @Controller、@Service、@Repository
2、自动按照类型注入
@Autoware(只有唯一bean对象时注入成功)
@Qualifier 必须和@Autoware一起使用此时就可以用@Resource注解代替
@Value基本类型和String类型的注入 @Value(${})
集合类型注入只能用XML
3、改变作用范围以及生命周期相关的注解
@Scope(singleton、prototype、request、seesion、scope-session)
@PostConstruct和@PreDestroy
4、基于XML的IOC案例
5、Spring的新注解
@Configuration、@ComponentScan、@Aliasfor(别名注解)
**细节:**当配置类作为AnnotationConfigApplicationContext对象创建参数时可以不写@Configuration注解
@Bean(用于把当前方法的返回值作为bean对象存入SpringIoc的容器中)
创建数据源
@Import(导入其他配置类)
@PropertySource
@Qualifer
@Test
@RunWith