解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题

来源:互联网 发布:淘宝卖家骗局大全 编辑:程序博客网 时间:2024/06/06 16:51

编写web.xml配置文件时候出现了下图错误



错误提示:cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. One of '{"http://

 java.sun.com/xml/ns/javaee":include-prelude, "http://java.sun.com/xml/ns/javaee":include-coda, "http://
 java.sun.com/xml/ns/javaee":deferred-syntax-allowed-as-literal, "http://java.sun.com/xml/ns/javaee":trim-directive-
 whitespaces, "http://java.sun.com/xml/ns/javaee":default-content-type, "http://java.sun.com/xml/ns/javaee":buffer, 

 "http://java.sun.com/xml/ns/javaee":error-on-undeclared-namespace}' is expected.


看了网上的方法http://henatne.iteye.com/blog/837186,果然解决了。

解决方法:

1.下载springmodules-cache.xsd和springmodules-ehcache.xsd两个文件,放在本地eclipse目录下

下载地址:http://download.csdn.net/detail/u011499686/9450785



2.打开window》preferences,输入xml,找到XML Catalog。




3.点击add,配置springmodules-cache.xsd。



4.点击File System 在本地路径选择springmodules-cache.xsd。补充key值。

   Location: D:\eclipse\springmodules-cache.xsd    (springmodules-cache.xsd本地的路径) 
   Key Type: Namespace Name 
   Key: http://www.springmodules.org/schema/cache/springmodules-cache.xsd 

 5.同理,配置springmodules-ehcache.xsd

Location: D:\eclipse\springmodules-ehcache.xsd(本地路径) 
    Key Type: Schema Location 
    Key: http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd 




5.点击ok,完成配置。.


5.最后,在报错的web.xml中的xmlns:xsi=""中加上 http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd

bug就消除了。





参考网站:http://henatne.iteye.com/blog/837186

http://wenku.baidu.com/link?url=pEBtVQFzTx0I9T9vr01WS6_NmOY7EylNwa-suKpx3ab1YZfL4QvYsPt2chXyvXOvkXEcdju7rzOV-v7oXVrq6ZhfuTtrbC4kZI8y6ahs2QO

1 0
原创粉丝点击