在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;

"

双引号

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-24
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
猜你喜欢
  • 2021-07-08
  • 2021-07-22
  • 2021-10-20
  • 2022-01-12
  • 2021-10-28
  • 2021-08-10
  • 2021-09-10
相关资源
相似解决方案