web.xml配置文件中<async-supported>true</async-supported>报错的解决方案

作者:じ☆ve宝贝

发布时间:2016-03-21T09:19:18

web.xml总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误

在eclipse中的web.xml添加: 1、 http://www.springmodules.org/schema/cache/springmodules-cache.xsd 2、http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd 如下面代码:

<?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://www.springmodules.org/schema/cache/springmodules-cache.xsd 
	http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">

	<!-- Spring MVC -->
	<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:/cn/studyjava/context/spring-mvc.xml
			</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
		<async-supported>true</async-supported>
	</servlet>
	<servlet-mapping>
		<servlet-name>springMVC</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>
</web-app>