<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

  <display-name>bos_collection_web</display-name>

  

  <!-- 指定位置 -->

  <context-param>

  <param-name>contextConfigLocation</param-name>

  <param-value>classpath:applicationContext.xml</param-value>

  </context-param>

  <!-- spring监听器 -->

  <listener>  

  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

  </listener>

  <!--对编码格式进行过滤  -->

    <filter>

  <filter-name>characterEncodingFilter</filter-name>

  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

  <!-- 在加载过滤器的时候初始化编码格式 -->

  <init-param>

  <param-name>encoding</param-name>

  <param-value>utf-8</param-value>

  </init-param>

  </filter>

  <filter-mapping>

  <filter-name>characterEncodingFilter</filter-name>

  <url-pattern>/*</url-pattern>

  </filter-mapping>

  

  <!-- 解决hibernate延迟加载问题的过滤器 (no session问题) -->

  <filter>

  <filter-name>openSessionInViewFilter</filter-name>

  <filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class>

  </filter>

  <filter-mapping>

  <filter-name>openSessionInViewFilter</filter-name>

  <url-pattern>/*</url-pattern>

  </filter-mapping>

  <!-- struts2过滤器 -->

  <filter>

  <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>  

  </filter>

  <filter-mapping>

  <filter-name>struts2</filter-name>

  <url-pattern>/*</url-pattern>

  <!-- 拦截请求转发 -->

  <dispatcher>REQUEST</dispatcher>

  <dispatcher>FORWARD</dispatcher>

  </filter-mapping>

  <welcome-file-list>

    <welcome-file>index.html</welcome-file>

    <welcome-file>index.htm</welcome-file>

    <welcome-file>index.jsp</welcome-file>

    <welcome-file>default.html</welcome-file>

    <welcome-file>default.htm</welcome-file>

    <welcome-file>default.jsp</welcome-file>

  </welcome-file-list>

</web-app>