您的位置:首页 > 运维架构 > Tomcat

配置Apache和Tomcat使用UTF-8编码

2014-05-29 14:47 330 查看
以下技术应用于最优质的水果的鲜果篮

1, Goto your apache folder i.e. /etc/httpd/conf and add AddDefaultCharset utf-8 in httpd.conf file. Note: First check that it is exist or not. If exist you may update it with this line. You can add this line at bottom also.

2,Goto your tomcat folder i.e. $CATALINA_HOME/conf/server.xml, change releated setting for following 2 component.

<Connector port="8080" maxHttpHeaderSize="8192"

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

enableLookups="false" redirectPort="8443" acceptCount="100"

connectionTimeout="20000" disableUploadTimeout="true"

compression="on"

compressionMinSize="128"

noCompressionUserAgents="gozilla, traviata"

compressableMimeType="text/html,text/xml,text/plain,text/css,text/ javascript,application/x-javascript,application/javascript"

URIEncoding="UTF-8"

/>

...

...

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: