标签:c style class blog code java
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
  
    <servlet>
    <!-- Servlet的名字是 springmvc,可以有多个DispatcherServlet,是通过名字来区分的。每一个DispatcherServlet有自己的
        WebApplicationContext上下文对象。同时保存的ServletContext中和Request对象中,关于key,以后说明。 在DispatcherServlet的初始化过程中,框架会在web应用的
        WEB-INF文件夹下寻找名为[servlet-name]-servlet.xml 的配置文件,生成文件中定义的bean。 -->
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!-- 启动顺序,让这个Servlet随容器一起启动 -->
        <load-on-startup>1</load-on-startup>
    </servlet>
  
    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <!-- 注意不要使用/* -->
        <!-- 会拦截* 结尾请求 -->
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>
</web-app><?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <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-mapping>
        <servlet-name>springMVC</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>SpringMVC DispatcherServlet 说明与web配置,布布扣,bubuko.com
SpringMVC DispatcherServlet 说明与web配置
标签:c style class blog code java
原文地址:http://blog.csdn.net/hao947/article/details/27839365