JSP page message appears Chinese garbled code solution

  • 2020-04-01 03:27:01
  • OfStack

Many JSP programmers have encountered this situation, JSP pages pass parameters to the servlet, as long as the parameters are in Chinese is garbled, and most are?????????? Garbled code, tried the Internet more common a good variety of methods are not, finally added a sentence to solve the problem, here to share for your reference.

1. Open the tomcat installation directory

2. Find the conf folder

3. Open the server.xml inside

4. To find


<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000" 
redirectPort="8443" />

The label

Add at the end of the tag


URIEncoding="UTF-8"

This sentence

Becomes as follows:


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

Problem solved now!


Related articles: