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

2023-10-27

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

原因:文档内容标签顺序不符合web-app_2_3.dtd规范 

解决方案 一:

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

2:删除<!DOCTYPE 。。。。这段内容 

解决方案 一:

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

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

替换后的效果如下:

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

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

  • transUnet

    TransUNet Transformers Make Strong Encoders for Medical Image Segmentation 背景 医学图像分割是开发医疗保健系统 尤其是疾病诊断和治疗计划 的必要前提 问题 U Ne

随机推荐