tomcat在centos下出现中文乱码怎么办


本文摘自PHP中文网,作者V,侵删。

1、设置当前系统的语言环境为中文

1

2

3

4

[root@iZ25bdzgev8Z ~]# locale  #查看当前系统的语言环境

[root@iZ25bdzgev8Z ~]# yum -y install kde-l10n-Chinese  #安装中文语言包, yum源配置在阿里

[root@iZ25bdzgev8Z ~]# yum reinstall glibc-common

[root@iZ25bdzgev8Z ~]# LANG="zh_CN.UTF-8"

2. 编辑server.xml文件,进行如下修改

1

2

3

4

<Connector port="9999" protocol="HTTP/1.1"

    connectionTimeout="20000" URIEncoding="UTF-8"  useBodyEncodingForURI=”true”

    redirectPort="8443" />

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"   />

3、编辑项目下的数据库连接文件/var/lib/tomcat/webapps/myproject/WEB-INF/classes/config.properties,修改如下:

1

jdbc.url=jdbc:mysql://IP地址:3306/ myprojectDB?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useOldAliasMetadataBehavior=true

4、修改Web.xml文件

阅读剩余部分

相关阅读 >>

linux数据库乱码解决方法

centos怎么安装deb格式软件包

linux中字符乱码解决方法介绍

centos如何查看用户

centos下ssh登录失败怎么办

centos外网ping不通怎么解决

分享centos修改ip的两种方式

telnet不通linux中的tomcat端口

linux如何安装apache tomcat

安装centos时找不到u盘怎么解决

更多相关阅读请进入《tomcat》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...