zoukankan      html  css  js  c++  java
  • web.xml 基本配置(SSM maven项目)

    <web-app>
      <display-name>Archetype Created Web Application</display-name>
        <!--web.xml  的基本配置-->
        <!--1   启动spring的容器-->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext.xml</param-value>
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener
            </listener-class>
        </listener>
    
        <!--2   Springmvc 前端控制器  拦截所有请求-->
        <servlet>
            <servlet-name>dispatcherServlet</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>dispatcherServlet</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    
        <!--3 字符编码控制器  一定放在所有过滤器之前-->
        <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>
            <init-param>
                <param-name>forceRequestEncoding</param-name>
                <param-value>true</param-value>
            </init-param>
            <init-param>
                <param-name>forceResponseEncoding</param-name>
                <param-value>true</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>CharacterEncodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    
        <!--4、使用Rest风格URI  将页面普通的post请求  指定的delete或者put请求  -->
        <filter>
            <filter-name>HiddenHttpMethodFilter</filter-name>
            <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>HiddenHttpMethodFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    
    
    </web-app>
  • 相关阅读:
    建筑经济与企业管理 【1090】
    31 任意进制计数器的构成方法1
    30 同步计数器
    29 典型的时序电路模块2
    STM32的FSMC详解
    28 典型的时序电路模块1
    27 FSM,时序电路的分析方法
    26 电路结构和逻辑功能的关系
    25 触发器逻辑功能的分类
    24 触发器的电路结构和动作特点
  • 原文地址:https://www.cnblogs.com/mzdljgz/p/11143047.html
Copyright © 2011-2022 走看看