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

报错信息:

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 中标签的顺序不对,必须按照报错信息中标签的顺序进行,

常见的:filter等的标签应放在servlet等标签的前面

解决方法:

按照报错信息中括号的顺序更改web.xml中标签的顺序就行了

ps: 如果有任何问题可以评论留言,我看到后会及时解答,评论或关注,您的鼓励是我分享的最大动力

猜你喜欢

转载自blog.csdn.net/qq_40938301/article/details/83473202