httpclient get请求中文参数 tomcat服务器接收 乱码问题

客户端请求(采用utf-8的编码方式):HttpGet request=new HttpGet(url+"?userName="+URLEncoder.encode(userName, "utf-8")+"&password="+URLEncoder.encode(password, "utf-8"));

tomcat服务器:struts2接收总是乱码;

解决:tomcat server.xml  中修改

<Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               URIEncoding="UTF-8"

              。。。。。。

你可能感兴趣的:(httpclient,tomcat,ssh,中文参数乱码)