1,web.xml里配置
<web-app version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
其中http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">一行报错:
cvc-complex-type.2.3: Element 'web-app' cannot have character [children], be
解决方法:
将上面的第二行xmlns="http://java.sun.com/xml/ns/javaee"改为:
xmlns="http://java.sun.com/xml/ns/j2ee"
本文解决了一个关于web.xml配置中出现的错误,具体是元素'web-app'不能有字符[子节点]的问题。通过将xmlns属性值从'http://java.sun.com/xml/ns/javaee'更改为'http://java.sun.com/xml/ns/j2ee',成功解决了该问题。

4121

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



