java web.xml报错cvc-complex-type.2.3: Element 'web-app' cannot have character [children]

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文件头为:

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后解决问题。

你可能感兴趣的:(JavaEE)