zoukankan      html  css  js  c++  java
  • web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app 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"
               version="3.0">
        <display-name>hcrj</display-name>    
        
        <welcome-file-list>
                <welcome-file>login.jsp</welcome-file>
        </welcome-file-list>
       
       <!--监听器启动spring容器-->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
       
       <!--指定spring配置文件-->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext-*.xml</param-value>
        </context-param>
    
        <!--配置post乱码过滤器-->
        <filter>
            <filter-name>characterEncodingFitler</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>characterEncodingFitler</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
      
      <!-- 请求的时候写隐藏的name="_method" value="delete|put|post|get" 只能使用_method 源码为 public static final String DEFAULT_METHOD_PARAM = "_method"; --> <filter>      <filter-name>hiddenHttpMethodFilter</filter-name>     <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> </filter> <filter-mapping>     <filter-name>hiddenHttpMethodFilter</filter-name>      <servlet-name>springmvc</servlet-name> </filter-mapping>    <!-- 自行配制的过滤器 <filter> <filter-name>loginFilter</filter-name> <filter-class>com.hcrj.filter.LoginFilter</filter-class> </filter> <filter-mapping> <filter-name>loginFilter</filter-name> <servlet-name>springmvc</servlet-name> </filter-mapping> --> <!--启动springmvc的前端控制器--> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springmvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!--将该servlet设置为默认的servlet--> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>   
    人生没有彩排,每天都是现场直播!
  • 相关阅读:
    Linux-获取当前正在执行脚本的绝对路径
    Linux-SSL和SSH和OpenSSH,OpenSSL有什么区别
    Nginx-SSI
    Linux-TCP/IP TIME_WAIT状态原理
    Linux-IP地址后边加个/8(16,24,32)是什么意思?
    Nginx-/etc/sysctl.conf 参数解释
    Linux-内核缓存区和write行为
    常用音频软件:Cool edit pro
    常用音频软件:Wavesufer
    【转】智能音箱技术概览
  • 原文地址:https://www.cnblogs.com/northern-light/p/8539090.html
Copyright © 2011-2022 走看看