Web Service中Autowired失效的问题
来源:互联网 发布:sql导入excel数据 编辑:程序博客网 时间:2024/05/16 18:05
在发布WebService的时候,我们发现在server中使用spring的Autowired并不能够真正注入数据,这是一个很困惑的问题,但是实际上,我们可以用以下代码获得注入的对象
ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
SessionFactory sf=(SessionFactory)ctx.getBean("sessionFactory");
另外附上两篇对该问题的探讨文章
http://www.tuicool.com/articles/zIJju2U
http://wenku.baidu.com/link?url=DOQEDDYXkOTgBb2O7RE3c1AKmnx9G2cAaUNUNWzh1z-QBxm267HJC99bNUBRA6GT6nkXG9h6UDO8bBZeLLnoFdPyRMOyOF-T1whrbH2bSKO
0 0
- Web Service中Autowired失效的问题
- 静态 方法中使用Autowired注解的service或dao的问题
- [Spring] Spring MVC中@Autowired注释失效的可能原因
- 解决@Autowired在ServletContextListener中失效的一种方法
- SpingBoot集成shiro,MyRealm中无法@Autowired注入Service的问题
- web Service中遇到的问题
- XML Web Service的异步调用中可能的问题
- 使用web service在实施中遇到的 问题
- 在Web Service中使用SPS Object 的相关问题?
- Web Service开发中需要注意的问题
- Web Service开发中需要注意的问题
- web service 开发过程中遇到的问题汇总:
- WEB中关于document.getElementsByName在IE中失效的问题
- 关于web service 的问题
- spring中@Autowired、@Resource和@Service
- Web开发遇到的最蹊跷的问题:中hidden属性失效
- @resource或@Autowired Service service不能通过spring注入问题
- Spring2.5中annotation配置中@Override、@Component、 @Controller、 @Service、 @Repository、@Autowired的解析
- 【JAVA基础知识总结】Java I/0流概述以及使用方法
- mysql用户资源限制
- C#容器类实例
- xcode新建工程时出现fatal: unable to auto-detect email address (got 'Rabstone@bogon.(none)')错误
- UITextField格式化银行卡号
- Web Service中Autowired失效的问题
- C# Lambda表达式
- unity log写入文件
- opencv中Mat的type、channels、dims、depth
- C99标准学习笔记(4)——sizeof运算符
- easyUI 1.3.2 dataGrid动态绑定列名和数据
- Reverse Nodes in k-Group
- hdu5249KPI动态中位数(两个set)
- Redis3.0.1集群环境搭建