我的web.xml中不允许使用元素监听器类/ servlet-name / servlet-class / load-on-startup

时间:2016-07-17 05:12:01

标签: java xml spring spring-mvc spring-4

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/classes/org/mstc/cloudesurface/config/applicationContext.xml</param-value>
</context-param>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.form</url-pattern>
</servlet-mapping>

此处不允许element listener-class/servlet-name/servlet-class/load-on-startup/url-pattern
如果我将<web-app xmlns.....version="3.1">更改为<web-app xmlns ... version="2.5">即可! 为什么呢?
弹簧框架版本是4.3.1我用过

0 个答案:

没有答案