以前都是在Linux下做开发,很少在windows下开发,今天用了下windows...搭建SSH项目,居然在Action中获取是发现是乱码...
其实解决方法很简单...
在Linux下要把所有的Encoding设置为UTF-8
在Windows下要把所有的Encoding设置为GBK
service.xml修改之前
<
Connector
port
="8080"
maxHttpHeaderSize
="8192"
maxThreads ="150" minSpareThreads ="25" maxSpareThreads ="75"
enableLookups ="false" redirectPort ="8443" acceptCount ="100"
connectionTimeout ="20000" disableUploadTimeout ="true" />
maxThreads ="150" minSpareThreads ="25" maxSpareThreads ="75"
enableLookups ="false" redirectPort ="8443" acceptCount ="100"
connectionTimeout ="20000" disableUploadTimeout ="true" />
修改之后
<
Connector
port
="8080"
maxHttpHeaderSize
="8192"
maxThreads ="150" minSpareThreads ="25" maxSpareThreads ="75"
enableLookups ="false" redirectPort ="8443" acceptCount ="100"
connectionTimeout ="20000" disableUploadTimeout ="true" URIEncoding="GBK" />
maxThreads ="150" minSpareThreads ="25" maxSpareThreads ="75"
enableLookups ="false" redirectPort ="8443" acceptCount ="100"
connectionTimeout ="20000" disableUploadTimeout ="true" URIEncoding="GBK" />
转载于:https://blog.51cto.com/kinglixing/722772