0 0

spring 3.0 中删除了ContextLoaderServlet?10

最近下载了spring3.0 原来的程序 启动spring的时候是 以
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
</servlet>
启动的。。但是换成3.0的以后 告诉我找不到ContextLoaderServlet这个类 我看了一下 包中确实没有ContextLoaderServlet类? 难道是spring3.0中把  ContextLoaderServlet 移除了?
现在换成监听器的方式启动了。暂时能用。但是我想问下。。ContextLoaderServlet 为什么没有了?如果是移除了 有没有向替代的类?
2010年1月03日 12:58

3个答案 按时间排序 按投票排序

0 0

妈淡,就说怎么找不到,原来删除了.....坑爹啊.....

2013年8月05日 15:59
0 0

3.0也已经发布声明说,已经移除了,那就用ContextLoaderListener的方式了嘛
没有替代的类实现哦,

可能是它觉得ContextLoaderServlet 来加载spring不是很好的方式

2010年1月14日 16:36
0 0

你可以查看一下spring3.0的change log
http://static.springsource.org/spring/docs/3.0.x/changelog.txt
里面注明:
removed ContextLoaderServlet and Log4jConfigServlet
的确是去掉了

spring有三种启动方式,使用ContextLoaderServlet,ContextLoaderListener和ContextLoaderPlugIn

可以采用余下两种启动方式ContextLoaderListener和ContextLoaderPlugIn
建议使用ContextLoaderListener

2010年1月03日 15:43

相关推荐

    Spring学习资料

    ContextLoaderServlet是Spring 3.0之前的加载方式,现在已被弃用。而ContextLoaderListener则是一个监听器,可以在Web应用启动时加载配置文件,创建ApplicationContext,并将上下文信息存储在ServletContext中,方便...

    Spring中ApplicationContext加载机制

    Spring中ApplicationContext加载机制 ApplicationContext 是 Spring 框架中的核心组件之一,负责加载和管理应用程序中的 Bean 对象。在 Web 应用程序中,ApplicationContext 的加载机制是非常重要的, Spring 提供...

    spring-web-2.5.jar

    org.springframework.web.context.ContextLoaderServlet.class org.springframework.web.context.ServletConfigAware.class org.springframework.web.context.ServletContextAware.class org.springframework.web....

    加载spring 文件,在web.xml中的配置

    在Spring框架中,Web应用程序的配置通常涉及到对`web.xml`文件的设置,这是传统的部署描述符,用于定义Servlet、监听器和其他Web组件。当我们谈论“加载Spring文件,在web.xml中的配置”时,主要是指如何在Web应用...

    Struts+spring+hibernate整合.docx

    然后,分别添加Struts 1.2、Hibernate 3.3和Spring 3.0的库文件到项目的类路径中,以确保它们的可用性。 接下来是加入Spring支持。在`web.xml`中,我们需要配置一个`ContextLoaderServlet`,它会在Web应用启动时...

    spring与axis的整合

    - **Spring框架配置**:在`Web.xml`文件中,通过`ContextLoaderServlet`加载Spring的配置文件`applicationContext.xml`。这是Spring框架启动时读取配置信息的关键步骤,通过`contextConfigLocation`参数指定配置文件...

    spring配置.txtspring配置.txt

    通过对给定文件的分析,我们了解了Spring框架中XML配置的基本用法,包括如何配置`ContextLoaderListener`和`ContextLoaderServlet`,以及如何利用自动装配机制来简化依赖注入过程。这些配置对于构建基于Spring的Web...

    struts 整合spring 例子,测试通过

    Struts2 和 Spring 整合是Java开发中常见的实践,主要目的是为了利用Spring的强大功能,如依赖注入(DI)和面向切面编程(AOP),同时保持Struts2的MVC架构的优势。以下是对整合过程的详细说明: 首先,Spring框架...

    spring中的所有配置

    ### Spring中的配置详解 #### 1. **监听器(Listener):ContextLoaderListener** 在Spring框架中,`ContextLoaderListener`是一个非常重要的监听器,它用于初始化Web应用程序上下文。当Web容器启动时,它会触发`...

    配置spring

    在web.xml中,我们需要配置Spring的`ContextLoaderServlet`来初始化Spring容器。这通常通过`&lt;servlet&gt;`标签来完成,其中`servlet-class`是`org.springframework.web.context.ContextLoaderServlet`,并设置`load-on...

    spring在web.xml中和在struts中的不同配置.[收集].pdf

    在Java Web开发中,Spring和Struts是两个非常流行的框架,它们在应用程序的配置上有一定的差异。本篇文章将深入探讨Spring在`web.xml`中与在Struts中的不同配置方式,以及这两种方式背后的设计思想。 首先,...

    spring在web.xml中和在struts中的不同配置..pdf

    在Spring中,Bean的实例化、管理和依赖注入都在这个容器中完成。 在`web.xml`中配置Spring,主要涉及两步。第一步是定义`context-param`,指定Spring的配置文件路径,例如: ```xml &lt;param-name&gt;...

    struts2+spring整合

    Struts2和Spring的整合是Java企业级开发中常见的技术结合,主要目的是为了利用Spring的强大IoC(控制反转)和AOP(面向切面编程)功能,以及Struts2的优秀MVC架构来构建可维护性和扩展性更强的Web应用。下面我们将...

    spring与struts2整合

    Spring 和 Struts2 整合是企业级 Java 开发中常见的技术组合,这两种框架的结合可以充分利用它们的优点,提供灵活的控制层和强大的持久化支持。下面将详细解释整合过程中的关键知识点。 首先,整合所需的基础组件...

    spring与struts的整合

    - **ContextLoaderPlugIn**:该插件用于初始化Spring的应用上下文,将Spring配置文件加载到内存中。这里的`contextConfigLocation`属性指定了Spring配置文件的位置。 ##### 2. 配置ContextLoaderListener ```xml ...

    在Eclipse 中创建Spring的 Web应用.doc

    在Eclipse中创建一个基于Spring的Web应用涉及多个步骤,主要涵盖了Spring框架的Web模块、ApplicationContext的使用以及在Web容器中的配置。以下是详细的过程和相关知识点: 1. **Spring Web模块**: Spring框架...

    spring源代码解析

    可以通过使用Spring代码声明式的指定在web应用程序启动时载入应用程序上下文(WebApplicationContext),Spring的ContextLoader是提供这样性能的类,我们可以使用 ContextLoaderServlet或者ContextLoaderListener的...

    struts2整合spring

    1. **业务逻辑控制器类配置在Spring中** 在这种模式下,业务逻辑控制器类(即Action类)直接在Spring的配置文件中定义,并注入所需的业务类。同时,Action类的scope应设置为`prototype`。 ```xml ``` ...

Global site tag (gtag.js) - Google Analytics