首页 > Windows开发 > 详细

maven web项目的web.xml报错The markup in the document following the root element must be well-formed.

时间:2018-08-05 11:35:31      阅读:176      评论:0      收藏:0      [点我收藏+]

maven项目里面的web.xml开头约束是这样的

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

当在后面加了东西就会报错:

The markup in the document following the root element must be well-formed.

翻译下错误:根元素后面的文档中的标记必须很好地形成。

解决方法:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5" ><!--这里的“/”代表当前标签结束啊啊啊啊-->
</web-app>

 

maven web项目的web.xml报错The markup in the document following the root element must be well-formed.

原文:https://www.cnblogs.com/shiwanming/p/9424731.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!