首页 > 技术文章 > spring 中常用注解

beibidewomen 2017-07-25 15:34 原文

1. @Resource  

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

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


推荐阅读