spring 中常用注解

1. @Resource  

@Resource(name="userDaoImpl")
private UserDao userDao1;

这是定义在字段上的Annotation,是指userDao1使用xml配置文件中定义的名为“userDaoImpl”的bean进行填充 或是 使用 @Service(value="userDaoImpl")定义的bean进行填充。


posted @ 2017-07-25 15:34  beibidewomen  阅读(116)  评论(0编辑  收藏  举报