ssh中web.xml文件配置备份

来源:互联网 发布:如何清理mac磁盘空间 编辑:程序博客网 时间:2024/06/07 00:01

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

<web-app version="3.0" 

xmlns="http://java.sun.com/xml/ns/javaee" 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 

http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

  <display-name></display-name>

  <!-- 欢迎页面 -->

  <welcome-file-list>

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

  </welcome-file-list>

  <!-- 添加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>

  </filter-mapping>

  <!-- utf-8乱码的支持 -->

  <filter>

    <!-- 过滤器使用spring类CharacterEncodingFilter -->

    <filter-name>encodingFilter</filter-name>

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

       <init-param>

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

    <!-- 过滤器过滤后的编码为utf-8 -->

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

       </init-param>

  </filter>

  <filter-mapping>

    <!-- 过滤所有的路径:/*代表所有的路径 -->

    <filter-name>encodingFilter</filter-name>

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

  </filter-mapping>

  

  <!-- 添加spring的支持 -->

  <context-param>   

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

    <param-value>/WEB-INF/applicationContext*.xml</param-value>   

  </context-param>   

  <listener>   

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

  </listener> 

  

  

</web-app>

0 0