The content of element type "web-app" must match "(icon?,display- name?,description?...)

从svn检出一个web项目,转成maven之后,发现web.xml文件里面报错了,进去发现,提示

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*)”.

  • No grammar constraints (DTD or XML schema) detected for the document.

如图:
在这里插入图片描述

web.xml的配置出错了,根据提示可以看出是因为配置的顺序问题,意思就是应该严格按照 icon?,display-name?,description?,distributable等等这种顺序添加节点,根据这种顺序修改xml文件即可。

还有一种就是因为自己添加的这一部分代码不符合web-app_2_3.dtd规范,将第一行删除即可解决。

删除 即可。

猜你喜欢

转载自blog.csdn.net/weixin_40307206/article/details/103549526