解析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