1、@Autowired寻找类的时候默认是ByType,也就是通过类的类型来寻找类。不过,也可以通过借助@Qualifier("name")来指定寻找的类名

@Autowired

 public void setUserDAO(@Qualifier("u2")

2、@Resource默认是按名字来寻找类,当然要指定类的名字,如果不写name,还是按类型来查找类的

@Resource(name="")

最新文章

  1. JSON字符串和对象 的转换
  2. 月经贴——.net前景何妨!
  3. ASP.NET 5系列教程 (三):view components介绍
  4. 重新想象 Windows 8 Store Apps (66) - 后台任务: 下载和上传
  5. HDU 2717 Catch That Cow(BFS)
  6. AsyncQueryHandler 和 CursorAdapter的使用
  7. 关于Windows Azure的常见问题-执行与维护FAQ
  8. bzoj 1195: [HNOI2006]最短母串 爆搜
  9. [iOS]C语言技术视频-15-指针变量高级用法练习一(函数指针完成动态排序)
  10. JSP手动注入 全
  11. SpringMVC源码情操陶冶-AbstractHandlerExceptionResolver
  12. 解决hadoop中 bin/hadoop fs -ls ls: `.': No such file or directory问题
  13. Android项目-高考作文项目架构(三)
  14. 写一个python的服务监控程序
  15. windows下网络编程UDP
  16. 消息队列RabbitMq、ActiveMq、ZeroMq、kafka之间的比较
  17. CentOS7配置阿里云源
  18. Use a load-balancer as a first row of defense against DDOS
  19. webpack学习笔记—优化缓存、合并、懒加载等
  20. Aerospike系列:2:商业版和社区版的比较

热门文章

  1. 解决 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)
  2. [Compose] 17. List comprehensions with Applicative Functors
  3. Vim的使用 区域选择
  4. SQL语法 之 表连接
  5. CentOS连接网络注意事项
  6. mysql优化 慢查询(一)
  7. Linux-软件包管理-源码包安装
  8. Linux命令-文件处理命令:less
  9. 非super user管理会话
  10. [android开发之内容更新类APP]三、项目的基本功能之布局