When uploading Chinese information through the interface, garbled characters will appear when request.getParameter() is used to obtain the value in the java background. Various transcodings were used in the code but were not processed. (Recommended java related video tutorials: java video tutorials)
Needs to be modified in the tomcat configuration file:
/conf/server.xml
Original :
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
is modified to:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="utf-8" />
For more java related articles, please pay attention to the java basic tutorial column.
The above is the detailed content of Java interface garbled solution. For more information, please follow other related articles on the PHP Chinese website!