@Autowired 和 @Resource 区别

Spring不但支持自己定义的@Autowired注解,还支持几个由JSR-250规范定义的注解,它们分别是@Resource

一般使用
<bean id="whiteNameListDao" class="xxx.impl.WhiteNameListDaoImpl" autowire="byName" />

@Autowired
IWhiteNameListDao whiteNameListDao;

你可能感兴趣的:(@Autowired)