關於web.xml中<web-app>錯誤提示的解決辦法
阿新 • • 發佈:2018-03-26
gpo must pan listen traints ppi schema pin try
在Java Web 編程時,需要配置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-app_2_3.dtd規範
解決辦法:1.檢查標簽的順序是否按照錯誤提示中的標簽順序寫的,按照它提示的順序來調整標簽順序就可以了。
2. 或者直接刪除web.xml頭部配置: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
關於web.xml中<web-app>錯誤提示的解決辦法