首页 > 数据库技术 > 详细

The reference to entity "characterEncoding" must end with the ';' delimiter (Mybatis + Mysql)

时间:2015-07-13 06:33:51      阅读:662      评论:0      收藏:0      [点我收藏+]

数据源配置时加上编码转换格式后出问题了:

The reference to entity "characterEncoding" must end with the ‘;‘ delimiter

这个错误就是 context.xml中设置数据源链接URL的问题   

<context-param>

    <param-name>url</param-name>

    <param-value>jdbc:mysql://localhost:3306/bookstore?useUnicode=true&characterEncoding=UTF-8</param-value>

</context-param>

正确的如下:

<context-param>

    <param-name>url</param-name>

    <param-value>jdbc:mysql://localhost:3306/bookstore?useUnicode=true&amp;characterEncoding=UTF-8</param-value>

</context-param>

这大概是由xml文件中的编码规则决定要这么变换。

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

 

 

&lt;

 

<

 

小于号

 

&gt;

 

>

 

大于号

 

&amp;

 

&

 

 

&apos;

 

 

单引号

 

&quot;

 

"

 

双引号

The reference to entity "characterEncoding" must end with the ';' delimiter (Mybatis + Mysql)

原文:http://www.cnblogs.com/panderen/p/4641966.html

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