By default, if the WebService or Web site that is deployed in Tomcat needs to have Chinese request parameters, and when we enter Chinese directly in the browser then the acceptance will be garbled, unable to meet our needs, At this point we need to set up the encoding format for Tomcat's request link.
Under Tomcat there is a conf directory with a server.xml configuration file, which has the following configuration for each port:
<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>
We need to add uriencoding= "UTF-8" at the end of this configuration, that is, the final form is:
<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
Redirectport= "8443"
uriencoding= "UTF-8"/>
Note: This line must be added to the last side, otherwise invalid, I personally tried, before adding to the third row results alive or not, very strange, and later debugging for a long time to find out this ghost is out in this order.
This configuration is only valid for a get type of request and is not valid for a POST request. The parameter encoding for the POST request is still "iso8859-1", not "UTF-8"
Request string encoding for "Tomcat" Tomcat configuration