<context:spring-configured/> 的作用
来源:互联网 发布:mac 桌面图标无效 编辑:程序博客网 时间:2024/05/02 13:43
Spring 可以为IOC容器里的bean进行依赖注入,但如果某些类,没有配置在IOC里,比如一些Domain Object,是否也可以依赖注入哪?答案是肯定的。
以User 为例,该User并没有配置在IOC理,但我想对其里面的一个UserDao进行依赖注入,其代码如下:
@Configurable(autowire = Autowire.BY_NAME, dependencyCheck = false)public class User { private String UserName; .... private UserDao userDao; ... @Autowired public void setUserDao〔UserDao userDao〕{ this.userDao=userDao. }}
然后再在XML文件里加上 <context:spring-configured/>就可以了。
<context:spring-configured/>主要是通过Spring管理AnnotationBeanConfigurerAspect切面, 具体的工作由该切面完成。
- <context:spring-configured/> 的作用
- <context:spring-configured/> 的作用
- <context:spring-configured/> 的作用
- 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:component-scan base-package="" />的作用
- 在Spring 中<context:annotation-config/>元素的作用
- spring中的标签context component-scan的作用
- Spring初始化:org.springframework.web.context.ContextLoaderListener的作用
- Context的作用
- <context-param>的作用
- context的作用
- Wince 发声
- 如何在Java中进行图片剪裁
- 解决jsp重复提交问题 .
- php如何发起POST DELETE GET POST 请求
- Oracle 多列子查询
- <context:spring-configured/> 的作用
- wince 软键盘的开启和关闭
- Android之webservice,基于soap协议的数据处理
- 官方网站的例子
- 转载设计模式摘要
- 【转】MFC在VS2010中开发ActiveX控件,设置测试容器方案
- 彻底解决谷歌浏览器不支持 document.formname.submit() 的方法,绝对有效!
- android中去掉标题栏和状态栏
- Linux2.6 内核的 Initrd 机制解析