设为首页 加入收藏

TOP

SSM衍生的配置文件(五)
2019-09-17 18:20:35 】 浏览:102
Tags:SSM 衍生 配置 文件
;true</param-value>

    </init-param>

  </filter>

  <filter-mapping>

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

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

  </filter-mapping>

</web-app>
SSM框架:基于spring将springmvc和mybatis进行整合
web.xml配置文件:

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

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" 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>

  <!-- 注册中央调度器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>/</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-

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

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目