首页 > 其他 > 详细

xml文件报错:The reference to entity "characterEncoding" must end with the ';' delimiter.

时间:2021-08-05 08:32:39      阅读:29      评论:0      收藏:0      [点我收藏+]

在xml文件中的mysql链接URL报错:The reference to entity "characterEncoding" must end with the ‘;‘ delimiter.

 

原因是在XML文件中,& 符号需要转义

<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
        connectionURL="jdbc:mysql://localhost:3306/ssm_crud??serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false"
        userId="root"
        password="root">
</jdbcConnection>

正确写法是

connectionURL="jdbc:mysql://localhost:3306/ssm_crud??serverTimezone=UTC&amp;characterEncoding=utf8&amp;useUnicode=true&amp;useSSL=false"

在xml文件中有以下几类字符要进行转义替换:

&lt;

<

小于号

&gt;

>

大于号

&amp;

&

&apos;

单引号

&quot;

"

双引号

xml文件报错:The reference to entity "characterEncoding" must end with the ';' delimiter.

原文:https://www.cnblogs.com/fangjb/p/15101227.html

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