码迷,mamicode.com
首页 > 移动开发 > 详细

关于web.xml中<web-app>错误提示的解决办法

时间:2018-03-26 19:13:44      阅读:1083      评论:0      收藏:0      [点我收藏+]

标签:glib   oca   sch   class   tag   env   cat   错误   table   

在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>错误提示的解决办法

标签:glib   oca   sch   class   tag   env   cat   错误   table   

原文地址:https://www.cnblogs.com/songyao2018/p/8652587.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!