报错原因

问题描述 : 在创建 SpringMVC 时 , 选用 idea 的 webapp 模板来创建 , xml 配置文件中进行配置时发现提示警告

警告如下:

这错误大概的意思就是:必须要匹配这个顺序。

解决方案

由于 web.xml 头文件比较旧。规定了代码的书写顺序所以报错。要么按照规定的顺序写代码。要么删除规定。但是删除规定会导致智能提升失效。

这里可以使用一些其他版本的 web.xml 的头文件来进行 web.xml 文件的配置

web.xml v2.3

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app> </web-app>

web.xml v2.4

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

web.xml v2.5

 <?xml version="1.0" encoding="UTF-8"?>
<web-app 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_2_5.xsd" version="2.5"> </web-app>

web.xml v3.0

 <?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">
</web-app>

The content of element type “web-app“ must match 解决方法的更多相关文章

  1. web.xml配置bug之提示The content of element type "web-app" must match "(icon?,display- name?,description?,distributable?,

    错误:配置web.xml时,出现红色叉叉,提示 The content of element type "web-app" must match "(icon?,disp ...

  2. 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-map

    修改了一下web.xml,加入了一个<filter>,然后就报这样的错??? The content of element type "web-app" must ma ...

  3. mybatis项目启动报错 The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".

    启动项目报错 2018-02-26 17:09:51,535 ERROR [org.springframework.web.context.ContextLoader] - Context initi ...

  4. Multiple annotations found at this line: - The content of element type "mapper" must match "EMPTY". - Attribute "namespace" must be declared for element type "mapper".

    今天在mybatis的mapper映射配置文件中遇到了这样的问题,困扰了我3个小时: Multiple annotations found at this line: - The content of ...

  5. The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,reflectorFactory?,plugins?,environments?,databaseIdProv

    在mybatis配置文件config.xml中报错: The content of element type "configuration" must match "(p ...

  6. The content of element type "package" must match "(result-types?,interceptors?...

    错误:“The content of element type "package" must match "(result-types?,interceptors?,de ...

  7. The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?...

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC & ...

  8. The content of element type "sqlMapConfig" is incomplete,

    The content of element type "sqlMapConfig" is incomplete, it must match "(properties? ...

  9. 【转】The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?...

    [转]The content of element type "configuration" must match "(properties?,settings?,typ ...

  10. The content of element type "beans" must match "(description?,(import|alias|bean)*)

    The content of element type "beans" must match "(description?,(import|alias|bean)*) - ...

随机推荐

  1. Revit BIM模型在ArcGIS Pro中的数据组织及转换成SLPK后的图层结构解析

    ArcGIS Pro对Revit 数据有自己的一套分层方式. 在ArcGIS Pro中打开bim文件会发现都是按照相同的方式组织数据: 将rvt格式数据转换成SLPK格式后的数据结构(将slpk数据直 ...

  2. 图与网络分析—R实现(一)

    图与网络 一个网络G,也可以称为图(graph)或网络图,是一种包含了节点V(即网络参与者,也称顶点)与边E(即节点之间的连接关系)的数学结构,记作G={V,E}.可以使用一个矩阵来存放节点之间的连接 ...

  3. python入门教程之二十三Python3 MySQL 数据库连接 - PyMySQL 驱动

    MySQL 是最流行的关系型数据库管理系统,如果你不熟悉 MySQL,可以阅读我们的 MySQL 教程. 本章节我们为大家介绍使用 mysql-connector 来连接使用 MySQL, mysql ...

  4. MySQL笔记之一致性视图与MVCC实现

    一致性读视图是InnoDB在实现MVCC用到的虚拟结构,用于读提交(RC)和可重复度(RR)隔离级别的实现. 一致性视图没有物理结构,主要是在事务执行期间用来定义该事物可以看到什么数据. 一.Read ...

  5. Redis读书笔记(三)

    单机数据库的实现 Redis数据库 Redis数据库的实现 struct redisServer { //... //保存服务器中的所有数据库, 数组 redisDB *db; //服务器的数据库数量 ...

  6. 数组练习 fill sort

    package day05; import java.util.Arrays; //fill sort equals public class testArrays { public static v ...

  7. ARouter源码分析

    源码看过好几遍了,但是总是会忘记,特此记录下 先从注解处理器开始 BaseProcessor是其他三个注解处理器的抽象类,子类去实现process方法.在其中的init方法中会获取我们的module模 ...

  8. ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected DG开启MRP失败

    问题描述:在10.2.0.5的备库中open状态下开启实时同步,开启失败.一直卡着,只能强制停止 SQL> alter database recover  managed standby dat ...

  9. 【Spring5】数据库事务操作

    Spring针对事务的操作 事务的概念:事务是数据库最基本的单元,逻辑上的一组操作,要么都成功,如果有一个操作失败则都失败. 事务的特性:ACID 原子性.一致性.隔离性.持久性 JavaEE环境三层 ...

  10. day01-项目介绍&功能实现

    项目介绍&功能实现 1.项目介绍&环境搭建 一个以社交平台为核心的轻电商项目,功能如下: 短信登录.商户查询缓存.优惠券秒杀.达人探店.好友关注.附近的商户.用户签到.UV统计 1.1 ...