在eclipse中建立maven项目,整合了SSM,还有一些其他框架内容比较多,web.xml当中报这个错误,还出现小红叉,解决办法:
 
在web.xml头几行,找到“xmlns:xsi”标签,如下:
 
<web
-app xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"  
添加两行:
 
http://www
.springmodules.org/schema/cache/springmodules-cache
.xsd       
http://www
.springmodules.org/schema/cache/springmodules-ehcache
.xsd" 
改成如下:
 
<web-app xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance
        http:
        http: 
这样就不报错了。
 
改好以后,eclipse会在web.xml第一行提示一个黄色感叹号,内容是:  No grammar constraints (DTD or XML Schema) referenced in the document  要消除这个黄色感叹号,方法是在web.xml第二行加上:
 
<!DOCTYPE xml> 
改完之后就是:
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>  
然后还发现一个情况,不知道是不是都这样,就是
 
<?xml version="1.0" encoding="UTF-8"?> 
这一行必须是在web.xml的第一行,就是说第一行空着,第二行开始有内容也不行,还是会出现一个小红叉,<?xml version="1.0" encoding="UTF-8"?>必须出现在web.xml的第一行。