设为首页 加入收藏

TOP

SSM衍生的配置文件(四)
2019-09-17 18:20:35 】 浏览:99
Tags:SSM 衍生 配置 文件
quot; id="WebApp_ID" version="3.1">

  <display-name>25-SSM</display-name>

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

 

  <!-- 注册Spring的监听器ContextLoaderListener, 创建Spring的容器对象 -->

  <!-- 指定自定义配置文件的位置 -->

  <context-param>

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

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

  </context-param>

  <listener>

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

  </listener>

 

  <!-- 注册中央调度器DispatcherServlet, 创建SpringMVC的容器对象 -->

  <servlet>

    <servlet-name>dispatcherServlet</servlet-name>

    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

   

    <!-- 指定springmvc配置文件 -->

    <init-param>

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

        <param-value>classpath:conf/dispatcherServlet.xml</param-value>

    </init-param>

   

    <load-on-startup>1</load-on-startup>

  </servlet>

 

  <servlet-mapping>

    <servlet-name>dispatcherServlet</servlet-name>

    <url-pattern>*.do</url-pattern>

  </servlet-mapping>

 

  <!-- 注册字符集过滤器,解决post请求乱码的问题 -->

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

    <!-- 强制request使用encoding的值 -->

    <init-param>

        <param-name>forceRequestEncoding</param-name>

        <param-value>true</param-value>

    </init-param>

   

    <!-- 前置response使用encoding的值 -->

    <init-param>

        <param-name>forceResponseEncoding</param-name>

        <param-value>

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 4/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇千万级流量的优化策略实战 下一篇大型分布式电商系统架构是如何从0..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目