XML中&需要轉義 &


在XML文件中配置數據庫的連接,復制

<property name="connection.url">jdbc:mysql://localhost:3306/test?serverTimezone=UTC&characterEncoding=utf-8</property>

報錯誤:The reference to entity "characterEncoding" must end with the ';' delimiter.

原來是XML中需要將   “&”轉義“&amp;”

上述代碼改

<property name="connection.url">jdbc:mysql://localhost:3306/test?serverTimezone=UTC&amp;characterEncoding=utf-8</property>

錯誤消失!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM