Myeclipse中java web.xml报错cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element- only.


web.xml文件添加servlet访问限制后出现如下错误:

  cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element-  only.

翻译:

  cvc-complex-type.2.3:元素'web-app'不能包含character [children],因为该类型的内容类型是仅包含元素的。

错误截图如下:

  

解决办法一:

  出错原因为xml头文件中第三行:
  xmlns="http://java.sun.com/xml/ns/javaee"
  改成javaee改为j2ee后解决问题。

  

 解决办法二:

  由于是粘贴过来的编码可能有问题,将xml中的文本重新手打输入一遍,一般就会解决这种问题。

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM