cvc-complex-type.2.4.a: Invalid content was found starting with element ‘init-param’(转)
Posted on 2017-12-21 20:23 云小七 阅读(160) 评论(0) 编辑 收藏 举报 在写xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误,还出现小红叉,在网上找了很多,有说是把报红叉的代码写在<jsp-config></jsp-config>之间,试了之后发现完全没用。
后来在外文网站上找到了一个方法就把问题解决了
在eclipse中配置xmlcatalog
1、 Location: D:\eclipse3.3\springmodules-cache.xsd (springmodules-cache.xsd在本地的路径)
Key Type: Namespace Name
Key: http://www.springmodules.org/schema/cache/springmodules- cache.xsd
2、Location: D:\eclipse3.3\springmodules-ehcache.xsd(本地路径)
Key Type: Schema Location
Key: http://www.springmodules.org/schema/cache/springmodules- ehcache.xsd
然后再将这连个xsd加入到web.xml中就搞定了
后面可下载springmodules- cache.xsd 和springmodules-ehcache.xsd
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- 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" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
- ">