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

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

解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题_第1张图片


错误提示: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。

解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题_第2张图片



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

解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题_第3张图片


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 

解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题_第4张图片

解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题_第5张图片




5.点击ok,完成配置。解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题_第6张图片.


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

bug就消除了。

解决cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. ..问题_第7张图片




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

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

你可能感兴趣的:(web开发)