Object-C submits a GET request to Java, and garbled characters are obtained through request. getparamter () in Java.
The uriencoding of Tomcat needs to be modified as a UTF-8, as shown below
To ensure that the get data is UTF-8 encoded, the following settings are made in server. xml:
<Connector Port = "8080" maxthreads = "150" minsparethreads = "25"
Maxsparethreads = "75" enablelookups = "false" redirectport = "8443"
Acceptcount = "100" DEBUG = "99" connectiontimeout = "20000"
Disableuploadtimeout = "true" uriencoding = "UTF-8"/>
The data encoding for get is specified here. However, this setting fails when you use IIS or Apache as the webserver to forward Servlet/jsp requests to Tomcat. The reason is simple:
IIS/Apache forwards requests to port 8009 of Tomcat listening through the AJP protocol. Therefore, the settings for port 8080 are naturally invalid. The correct method is to make the following settings:
<Connector Port = "8009" enablelookups = "false" redirectport = "8443"
DEBUG = "0" protocol = "AJP/1.3" uriencoding = "UTF-8"/>