码迷,mamicode.com
首页 > Windows程序 > 详细

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

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

标签:style   5.x   XML   啊啊啊   报错   xsd   xmlns   win   enc   

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.

标签:style   5.x   XML   啊啊啊   报错   xsd   xmlns   win   enc   

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

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