web.xml文件添加ssl访问限制后出现错误:
cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element-only
原web.xml文件头为:<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
出错原因为xml头文件中第三行:
xmlns="http://java.sun.com/xml/ns/javaee"
改成j2ee后解决问题。
本文解决了一个关于web.xml文件中添加SSL访问限制后出现的XML格式错误问题。原本的XML头部声明不允许包含字符类型的孩子节点,通过更改命名空间从javaee到j2ee解决了这一问题。

4354

被折叠的 条评论
为什么被折叠?



