If Web. XML prompts the following error:
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*) "
You can try the following workarounds:
1. Remove the second line of the file <! DOCTYPE Web-app ... .. .. > This sentence description (not recommended)
2. Put the labels in the correct order (in the correct order), this method can sometimes solve the problem
3. Separate the pairing labels like <filter>--<filter-mapping> and <servlet>--<servlet-mapping>, i.e. all <filter > (<servlet>) is written together and all <filter-mapping> (<servlet-mapping>) are written together.
Attached: Web. XML Label Placement Order
1. Icon?
2. Display-name?
3. Description?
4. distributable?
5. context-param*
6. filter*
7. filter-mapping*
8. listener*
9. servlet*
10.servlet-mapping*
11.session-config?
12.mime-mapping*
13.welcome-file-list?
14.error-page*
15.taglib*
16.resource-env-ref*
17.resource-ref*
18.security-constraint*
19.login-config?
20.security-role*
21.env-entry*
22.ejb-ref*
23.ejb-local-ref
"?" Indicates that the label will occur up to 1 times, and "*" indicates multiple occurrences.
Web. XML Order not error