XML文件报错 The reference to entity "characterEncoding" must end with the ';' delimiter.

r囧r小猫 2022-04-16 02:13 267阅读 0赞

xml 报错 The reference to entity “characterEncoding” must end with the ‘;’ delimiter.,多半是没有使用转义字符的原因

xml 文件中使用这五种字符必须使用它们的转义字符, ‘ < ‘ 、 ‘ > ‘ 、 ‘ & ‘ 、 ‘ ‘ ‘ 、 ‘ “ ‘


































字符 转义字符 字符名
  &lt; 小于号
> &gt; 大于号
& &amp; 和号
&apos; 单引号
&quot; 双引号

例如、在xml中写jdbc的url连接,要使用 & 的转义字符 &

  1. <jdbcConnection driverClass="com.mysql.jdbc.Driver"
  2. connectionURL="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8"
  3. userId="root" password="root">
  4. </jdbcConnection>

发表评论

表情:
评论列表 (有 0 条评论,267人围观)

还没有评论,来说两句吧...

相关阅读