The content of element type "web-app" must match "(icon?,display-name?,description?,报错解决方案

在web.xml文件配置时报如下错误:

The content of element type

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-app_2_3.dtd规范 

解决方案 一:

1:严格按照提示上的顺序排列 

2:删除

解决方案 一:

我始终觉得删除总归是不好的,于是发现第二种解决方案,将下面的代码替换第5行(包括第5行)之前的代码就行。


替换后的效果如下:

The content of element type

你可能感兴趣的:(后端)