您的位置:首页 > Web前端

配置JNDI 报错 The reference to entity "characterEncoding" must end with the ';' delimiter

2013-04-09 09:59 701 查看
<Context path="/bizsample" docBase="E:/行业版/eclipse/workspace/bizsample/WebApp">

<Resource auth="Container"

name="jdbc/bizsample"

type="MySql"

maxActive="3306"

maxIdle="4"

maxWait="10"

username="root"

password="admin"

driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost:3306/test?useUnicode=true;characterEncoding=utf-8" />

</Context>

上边这种配置方式 会报The reference to entity "characterEncoding" must end with the ';' delimiter 这个错误。

这是由xml文件中的编码规则决定要这么变换。

在xml文件中有以下几类字符要进行转义替换:

<

<

小于号

>

>

大于号

&

&



'

'

单引号

"

"

双引号

正确的方式

<Context path="/bizsample" docBase="E:/行业版/eclipse/workspace/bizsample/WebApp">

<Resource auth="Container"

name="jdbc/bizsample"

type="MySql"

maxActive="3306"

maxIdle="4"

maxWait="10"

username="root"

password="admin"

driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8" />

</Context>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐