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

本文介绍了如何解决XML中web-app元素不能包含字符内容的问题。通过调整XML命名空间从Java.sun.com到java.sun.com,并建议手动编写而非复制粘贴来避免类似问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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


解:1

将头部文件

原来

<web-app version="3.0"
xmlns="http://Java.sun.com/xml/ns/javaee"

修改为

<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/j2ee"


解决2:不要粘贴,直接手写。或者将web.xml中有错误的部分删除重新写上,保存。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值