码迷,mamicode.com
首页 > Web开发 > 详细

ssh整合中web.xml配置文件

时间:2016-07-23 21:23:38      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:ssh框架整合web.xml配置

<?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>


本文出自 “11768969” 博客,请务必保留此出处http://11778969.blog.51cto.com/11768969/1829114

ssh整合中web.xml配置文件

标签:ssh框架整合web.xml配置

原文地址:http://11778969.blog.51cto.com/11768969/1829114

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!