导入工程,eclipse中报错:
The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-
mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
问题原因:web.xml中可能顺序不对,比如servlet和servlet-mapping交叉出现或者filter和filter-mapping交叉
解决方法有两种:
1.调整web.xml中节点顺序,先servlet再servlet-mapping(filter同理)
2.关闭eclipse中xml校验,步骤:Windows-Preference-Validation,disable all,apply再OK
本文介绍了解决 Eclipse 中因 web.xml 文件配置错误导致的问题。错误表现为元素类型 'web-app' 的内容不符合预期模式。文章提供了两种解决方案:一是调整 web.xml 文件中的节点顺序;二是关闭 Eclipse 的 XML 校验功能。
3787

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



