Solve the problem of garbled Url with Chinese parameters

Here I will introduce how to configure Tomcat to solve the problem of garbled Url with Chinese parameters;


First open the Tomcat installation directory, take Tomcat7 as an example, other versions are basically the same;

1454391117593077429.jpg


open conf file

1454391166890014358.jpg


Open server.xml

1454391299968024532.jpg


At about line 70, we add an attribute URIEncoding="UTF-8"


1454391361171014090.jpg


Do it like this. . This is the configuration method when the project is published.


The following describes how to configure when developing:

open eclipse

find server

1454391411687030232.jpg


Click on server.xml

1454391443968032571.jpg


As before, add URIEncoding="UTF-8" to support Url Chinese parameters;


Of course, there are other methods, which are more troublesome. For example, transcoding and filtering by yourself. It will not be introduced here.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325701512&siteId=291194637
Recommended