获取Application中的spring容器
2015-03-02 09:33
176 查看
方式1: ApplicationContext ac = (ApplicationContext) invocation.getInvocationContext().getApplication().get(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); 方式2: ServletContext sc = ServletActionContext.getServletContext(); ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(sc);
相关文章推荐
- 通过ApplicationContextAware获取spring容器中的bean
- 通过ApplicationContextAware获取spring容器中的bean
- Sping中根据applicationContent.xml获取spring容器
- JSP 获取spring容器中bean的两种方法总结
- web容器中获取spring容器实例
- Spring ApplicationContextAware获取上下文
- Java代码6种方法获取spring 容器的bean
- Java类获取spring 容器的bean的几种方式
- Spring+Servlet整合(如何向Servlet注入属性(转),servlet获取spring容器中的bean)
- BeanFactory作为Spring容器,程序需要手动获取Bean后处理器,然后手动注册!
- java代码中获取spring容器中的对象
- 关于spring获取webApplication.getBean多种途径和简单解释
- spring源码 — 二、从容器中获取Bean
- Spring 学习-------WebApplication (web 容器)启动
- 获取Spring容器对象
- 通过JNDI从服务器容器中获取资源_Spring JNDI+Mysql+Tomcat
- 获取Spring容器Bean对象工具类
- 关于spring获取webApplication.getBean多种途径和简单解释
- spring获取ApplicationContext对象的方法——ApplicationContextAware
- Spring(2)与接口配合使用和获取Bean容器的两种方式(BeanFactory 、ApplicationContext)