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

    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd" >

    <web-app>
    <!--配置spring的监听器,默认只2加载WEB-INF目录下的applicationContext.xml-->
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!--设置配置文件的路径-->
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

    <!--配置前端控制器-->
    <servlet>
    <servlet-name>dispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <!--加载springmvc。xml文件-->
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:springmvc.xml</param-value>
    </init-param>
    <!--启动服务器,创建该servlet-->
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>dispatcherServlet</servlet-name>
    <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!--解决中文乱码的过滤器-->
    <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>
    </web-app>
  • 相关阅读:
    实现图片加载从模糊到清晰显示的方法
    审批流程设计方案-介绍(一)
    SpringBoot+JPA实现DDD(一)
    RabbitMQ使用入门
    SpringBoot+JPA实现DDD(六)
    SpringBoot+JPA实现DDD(五)
    Spring Boot+JPA实现DDD(四)
    Spring Boot+JPA实现DDD(三)
    Spring Boot+JPA实现DDD(二)
    DDD入门之解决了什么问题(二)
  • 原文地址:https://www.cnblogs.com/LFY001023/p/14109627.html
Copyright © 2011-2022 走看看