web.xml 中配置元素错误提示 The content of element type “web-app“ must match “(icon?,display- name?...

配置xml.xml 文件,IDE提示错误信息如下:

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

 如图:

大概为配置的元素顺序不符合"http://java.sun.com/dtd/web-app_2_3.dtd" >规范,按照提示的顺序对文件中的元素进行调整:

Thecontentofelementtype"web-app"mustmatch"(
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)