web.xml 文件的配置 顺序

<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
   <!--  定义整合SiteMesh必须的ActionContextCleanUp Filter
  -->
<filter>
  <filter-name>struts-cleanup</filter-name>
  <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
  </filter>
 <!--  定义整合SiteMesh和核心 Filter
  -->
 <filter>
  <filter-name>sitemesh</filter-name>
  <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
  </filter>
 <!--  定义Struts2的FilterDispathcer的Filter
  -->
 <filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
  </filter>
 <filter-mapping>
  <filter-name>struts-cleanup</filter-name>
  <url-pattern>/*</url-pattern>
  </filter-mapping>
 <filter-mapping>
  <filter-name>sitemesh</filter-name>
  <url-pattern>/*</url-pattern>
  </filter-mapping>
 <!--  FilterDispatcher用来初始化struts2并且处理所有的WEB请求。
  -->
 <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
  </filter-mapping>

你可能感兴趣的:(Web,struts,filter)