Spring 配置中<context:annotation-config/> 的作用
来源:互联网 发布:网络教室软件 破解版 编辑:程序博客网 时间:2024/05/18 11:27
AutowiredAnnotationBeanP
PersistenceAnnotationBea
注册这4个
例如:
如果你想使用@Autowired注解,那么就必须事先在
<bean
如果想使用@ Resource
如果想使用@PersistenceContext注解,就必须声明PersistenceAnnotationBea
如果想使用
<bean
一般来说,这些注解我们还是比较常用,尤其是Autowired的注解,在自动注入的时候更是经常使用,所以如果总是需要按照传统的方式一条一条配置显得有些繁琐和没有必要,于是spring给我们提供<context:annotation-config/>的简化配置方式,自动帮你完成声明。
<context:component-scan
<context:annotation-config>
是用于激活那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过package sanning的方式)上面的注解。
<context:component-scan>除了具有
<context:annotation-config>的功能之外,
<context:component-scan>
还可以在指定的package下扫描以及注册javabean 。
转载自:http://blog.sina.com.cn/s/blog_872758480100wtfh.html
- 配置Spring <context:annotation-config/>的作用
- Spring 配置中<context:annotation-config/> 的作用
- Spring中<context:annotation-config/>的作用
- Spring中<context:annotation-config/>的作用
- Spring中<context:annotation-config/>的作用
- Spring中<context:annotation-config/>的作用
- Spring中<context:annotation-config/>的作用
- Spring中<context:annotation-config/>的作用
- spring <context:annotation-config /> 配置作用
- 在Spring 中<context:annotation-config/>元素的作用
- Spring配置中<context:annotation-config> VS <context:component-scan>
- Spring中的context:annotation-config作用
- Spring <context:annotation-config/> 作用讲解
- Spring配置项<context:annotation-config>的解释说明
- 关于Spring的<context:annotation-config/>配置详解
- 关于Spring中的<context:annotation-config/>配置
- Spring配置中的<context:annotation-config/>
- Spring配置中的<context:annotation-config/>
- UIAlertView
- HDU2952:Counting Sheep(BFS)
- 浅谈Hibernate3中对象的加载
- mac关闭屏幕的方式
- Madagascar2 经典对白
- Spring 配置中<context:annotation-config/> 的作用
- 理解焦点窗口,活动窗口与前景窗口
- 整数划分问题
- 移植内核过程中出现界面卡在"Uncompressing Linux... done, booting the kernel."
- 黑马程序员------毕老师视频笔记第九天------面向对象(异常上)
- 深入理解Activity的生存期(一)之完整生存期
- 绪论
- 将FASTREPORT部署到ASP.Net 程序中出现 FastReport handler not ...
- 2014北京邀请赛 B Beautiful Garden