配置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>
<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>
相关文章推荐
- The reference to entity "characterEncoding" must end with the ';' delimiter. Nested exception: The r
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- 【url】The reference to entity "characterEncoding" must end with the ';' delimiter
- dom4j:The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- .The reference to entity "characterEncoding" must end with the ';' delimiter.
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- The reference to entity "characterEncoding" must end with the ';' delimiter
- xml文件中配置JDBC源遇到问题 : The reference to entity "characterEncoding" must end with the ';' delimiter
- 配置文件中出现 The reference to entity "XX" must end with the ';' delimiter. 错误提示
- The reference to entity "password" must end with the ';' delimiter.的原因跟解决方法
- The reference to entity "characterEncoding" must end with the ';' delimiter.
- 在xml文件中配置数据库url需要带多个参数的时候IDE提示The reference to entity "characterEncoding" must end with the ';'