struts2不同版本在核心filter在web.xml中的配置

FilterDispatcher是struts2.0.x到2.1.2版本的核心过滤器。配置如下:
<filter>
    <filter-name>struts2</filter-name>
    <filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
Struts2.1.3开始,将废弃ActionContextCleanUp过滤器,而在StrutsPrepareAndExecuteFilter过滤器中包含相应的功能。     
三个初始化参数:      1、config参数:指定要加载的配置文件。逗号分割。     2、actionPackages参数:指定Action类所在的包空间。逗号分割。      3、configProviders参数:自定义配置文件提供者,需要实现ConfigurationProvider接口类。逗号分割。   
<!-- struts2的配置 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts-default.xml,struts-plugin.xml,struts.xml</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
时间: 2024-07-31 02:13:01

struts2不同版本在核心filter在web.xml中的配置的相关文章

Servlet在web.xml中的配置

import javax.servlet.*; import java.io.IOException; import java.io.PipedWriter; import java.io.PrintWriter; /** * Created with IntelliJ IDEA. * User: wbb * Date: 14-6-17 * Time: 上午11:56 * To change this template use File | Settings | File Templates.

springmvc在web.xml中的配置详解

                          <servlet> <servlet-name>springMvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-

Spring web.xml中的配置

转载博客:http://blog.163.com/zhangke_616/blog/static/191980492007994948206/ 在实际项目中spring的配置文件applicationcontext.xml是通过spring提供的加载机制,自动加载的容器中去,在web项目中,配置文件加载到web容器中进行解析,目前,spring提供了两种加载器,以供web容器的加载:一种是ContextLoaderListener,另一种是ContextLoaderServlet.这两种在功能上

spring在web.xml中的配置

在实际项目中spring的配置文件applicationcontext.xml是通过spring提供的加载机制,自动加载的容器中去,在web项目中,配置文件加载到web容器中进行解析,目前,spring提供了两种加载器,以供web容器的加载:一种是ContextLoaderListener,另一种是ContextLoaderServlet.这两种在功能上完全相同,只是一种是基于Servlet2.3版本中新引入的Listener接口实现,而另一种是基于Servlet接口实现,以下是这两种加载器在w

java的web.xml中&lt;url-pattern&gt;配置[转]

<servlet-mapping> <servlet-name>downLoadFile</servlet-name> <url-pattern>*.loadfile</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>pageservlet</servlet-name> <url-pattern>/pages

Jsp在Web.xml中的配置

下面列出web.xml常用的标签元素及这些标签元素的功能: 1.指定欢迎页面,例如: <welcome-file-list> <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index1.jsp</welcome-file> </welcome-file-list> 上面的例子指定了2个欢迎页面,显示时按顺序从第一个找起,如果

spring mvc在web.xml中的配置

spring mvc将所有的请求都经过一个servlet控制器-DispatcherServlet,这个servlet的工作就是将一个客户端的request请求分发给不同的springmvc控制器,既然是一个控制器Servlet就需要在web.xml中配置. <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.Dispa

struts2在web.xml中的配置

1 <filter> 2 <filter-name>struts2</filter-name> 3 <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> 4 </filter> 5 6 <filter-mapping> 7 <filter-name>struts2</filter-name> 8 <

在web.xml中添加配置解决hibernate 懒加载异常

在web.xml添加如下,注意:在配置在struts2的拦截器之前 <!-- 配置Spring的用于解决懒加载问题的过滤器 --> <filter> <filter-name>OpenSessionInViewFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class&g