解析XML报错 The reference to entity "characterEncoding" must end with the ';' delimiter


来自:http://blog.csdn.net/sinat_25306771/article/details/53921058

 

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

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文件中有以下几类字符要进行转义替换:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM