Get the App
SLTechnology News&Howtos  ›  Servers  › 

Tomcat cannot access Chinese paths or Chinese files under linux

Shulou Source: shulou.com Published: 2022-06-03 07:00:45 10月04日 Update

Problem description: under the linux environment, tomcat publishes pages and files containing Chinese names, browser access report 404, there is no problem with non-Chinese pages; I designed a prototype for RP to publish, which contains a large number of Chinese files and paths

Step 1: set tomcat, configure the server.xml file under the conf folder, and add URIEncoding= "UTF-8" as follows

Test, if it is not yet accessible, proceed to the next step

Step 2: check the operating system language setting. Enter locale at the terminal, and the system code will be displayed. In most cases, it will not be shown as follows (as shown below is normal)

Set the operating system language to UTF-8, enter LANG=en_US.UTF-8 at the terminal, and then enter locale to view the language settings. If it is the effect of the above picture, test it again. If successful, it should be permanently set to UTF-8

Set the method to modify LANG= "UTF-8" in the file / etc/sysconfig/i18n

-Shi Longgang

Tags: File UTF-8 Chinese system language input operating system Terminal question Page Test path success above again prototype name situation effect folder Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL NVidia Apple Linux Redmi