1.bean标签和注解的对应
bean标签对应的注解@component,该标签衍生出三个注解@Controller,@Service,@Repositroy用法和@Componet一致
bean标签属性scope对应的注解@Scope
bean标签属性init-method对应注解@PostConstruct
bean标签属性destroy-method对应注解@PreDestroy
2.依赖注入注解
@Autowired注解(Spring框架提供) 按照类型注入,如果无法确定唯一类型(接口有多个实现类),需要配合注解@Qualifier的使用
@Qualifier("id") 注解(Spring框架提供)按照id注入
@Resource注解(JDK提供) 注解属性name:配置类的id
3.spring对junit的支持
junit运行的时候底层使用了Runner对象,有一个默认使用的Runner对象,Spring对junit的支持ÿ