The content of element type "web-app" must match "

来源:互联网 发布:大闹宠物进阶数据 编辑:程序博客网 时间:2024/05/18 00:29

导入工程,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交叉

参考http://stackoverflow.com/questions/5712906/getting-error-the-content-of-element-type-web-app-must-match

解决方法有两种:

1.调整web.xml中节点顺序,先servlet再servlet-mapping(filter同理)

2.关闭eclipse中xml校验,步骤:Windows-Preference-Validation,disable all,apply再OK

0 0