`

the injection of servlet context for registering into spring context

阅读更多

在servlet中,无法使用使用spring管理的bean

当我们要serlvet使用注解的形式去注入容器中的bean,由于spring管理的bean和servlet context不在一个上下文环境中是无法相互注入的。因此必须显式的注入:

SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);

 

国统使用spring提供的SpringBeanAutowiringSupport工具类,将当前对象注入到spring上下文

0
1
分享到:
评论

相关推荐

    spring-boot-reference.pdf

    17. Spring Beans and Dependency Injection 18. Using the @SpringBootApplication Annotation 19. Running Your Application 19.1. Running from an IDE 19.2. Running as a Packaged Application 19.3. Using the...

    Thank you for registering Visual Studio 2010 Express for Windows Phone.

    Thank you for registering Visual Studio 2010 Express for Windows Phone.

    Spring-Reference_zh_CN(Spring中文参考手册)

    12.2.2. 在Spring的application context中创建 SessionFactory 12.2.3. HibernateTemplate 12.2.4. 不使用回调的基于Spring的DAO实现 12.2.5. 基于Hibernate3的原生API实现DAO 12.2.6. 编程式的事务划分 12.2.7. ...

    Fast and Accurate Calibration of a Kinect Sensor

    The method estimates the projection parameters for both color and depth cameras, the relative pose between them, and the function that converts kinect disparity units (kdu) into metric depth....

    The Java EE 6 Tutorial Basic Concepts 4th Edition

    Chapter 17: Introduction to Contexts and Dependency Injection for the Java EE Platform 305 Overview of CDI 306 About Beans 307 About Managed Beans 307 Beans as Injectable Objects 308 Using ...

    Spring中文帮助文档

    2.6.4. 将Spring 应用程序上下文部署为JCA adapter 2.6.5. 计划任务 2.6.6. 对Java 5 (Tiger) 支持 2.7. 移植到Spring 2.5 2.7.1. 改变 2.8. 更新的样例应用 2.9. 改进的文档 I. 核心技术 3. IoC(控制反转)...

    DigitalEyewear-7-0-50

    Vuforia's support for digital eyewear enables the creation of mixed reality AR/VR gaming and educational experiences for video-see through devices and AR experiences for optical see-through devices ...

    Spring API

    2. Spring 2.0和 2.5的新特性 2.1. 简介 2.2. 控制反转(IoC)容器 2.2.1. 新的bean作用域 2.2.2. 更简单的XML配置 2.2.3. 可扩展的XML编写 2.2.4. Annotation(注解)驱动配置 2.2.5. 在classpath中自动搜索组件...

    spring4 中文API

    - **Additional Capabilities of the ApplicationContext**:介绍了Application Context的附加能力。 - **The BeanFactory**:解释了BeanFactory接口的角色和使用方法。 #### Resources - **Introduction**:概述...

    spring chm文档

    Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright...

    Servlets和JSP核心技术 卷2(英文版) 第一部分

    Monitoring Creation and Destruction of the Servlet Context Section 6.2. Example: Initializing Commonly Used Data Section 6.3. Detecting Changes in Servlet Context Attributes Section 6.4. Example: ...

    Servlets和JSP核心技术 卷2(英文版) 第二部分

    Monitoring Creation and Destruction of the Servlet Context Section 6.2. Example: Initializing Commonly Used Data Section 6.3. Detecting Changes in Servlet Context Attributes Section 6.4. Example: ...

    Mask 98 for PRwin98

    ..and a copy of which is now included on the Mask for Windows - PRWin98 distribution disk in the 'CALMIR22.EXE' self-extracting file (or obtainable via our website) for your use on the ...

    Spring 2.0 开发参考手册

    12.2.2. 在Spring的application context中创建 SessionFactory 12.2.3. HibernateTemplate 12.2.4. 不使用回调的基于Spring的DAO实现 12.2.5. 基于Hibernate3的原生API实现DAO 12.2.6. 编程式的事务划分 12.2.7...

    基于ssm+mysql的编程类在线答题系统源码数据库论文.docx

    Spring provides the foundation for dependency injection and application structure, SpringMVC handles the web-related aspects, and MyBatis serves as the ORM (Object-Relational Mapping) tool, enabling ...

    The Fundamentals of Efficient Synthesizable Finite State Machine.pdf

    This paper details proven RTL coding styles for efficient and synthesizable Finite State Machine (FSM) design using IEEE-compliant Verilog simulators. Important techniques related to one and two ...

    ActiveDocument

    If the application is executed without the "/embedding" switch, a dialog box will be displayed that has options for registering the server and creating a working file. When Register Server is selected...

    Developing Statistical Software in Fortran 95

    They emphasize the need for good programming practices, particularly in the context of research dissemination and adherence to programming standards. The benefits of adhering to these practices ...

    A Fast ICP Algorithm for 3-D.pdf

    Abstract—Iterative closest point (ICP) algorithm has been widely used for registering the geometry, shape and color of the 3-D meshes. However, ICP requires a long computation time to find the ...

Global site tag (gtag.js) - Google Analytics