Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if IDEA starts the Tomcat project to output garbled codes

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the IDEA start Tomcat project output garbled how to do, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

At the beginning, I did not debug successfully and put it down again, and the old system ran under MyEclipse. These two days, MyEclipse and Tomcat often had problems. I took this opportunity to try again and succeeded.

Most debugging methods come from here, but there are fine-tuning.

Set VM options in tomcat Server with a value of-Dfile.encoding=UTF-8, but unfortunately it does not take effect

Note: at the beginning, I also set it to UTF-8, but when I set it around, the message of the log line in the Console window is valid, but the content of the log line is still garbled, so I tried to change this step to GBK, and it was a success.

2, set the encoding format in File encodings in setting, and later found that this is to set the page encoding format, so it did not take effect, but friends who encounter related problems do not follow this setting.

These should be set up as soon as IDEA is installed.

3. Set the value of Additional command line parameters in java Complier,-encoding=UTF-8, which unfortunately does not take effect yet.

4. Set the parameters in idea.exe.vmoptions and idea64.exe.vmoptions in bin and add-Dfile.encoding=UTF-8 at the same time. It is said that some people can save it and restart it, but it still doesn't work on my side.

5. Add-Dfile.encoding=UTF-8 to the catalina.bat file in the tomcat\ bin directory, but it doesn't work yet.

6. Under the tomcat / conf directory, set logging.properties and add the parameter java.util.logging.ConsoleHandler.encoding = GBK. After restarting, you can finally breathe a sigh of relief.

These are added together at the end.

Catalina.org.apache.juli.FileHandler.encoding = GBKlocalhost.org.apache.juli.FileHandler.encoding = GBKmanager.org.apache.juli.FileHandler.encoding = GBKhost-manager.org.apache.juli.FileHandler.encoding = GBKjava.util.logging.ConsoleHandler.encoding = GBK

Finally, the normal display.

7. In addition, tomcat needs to set parameters in server.xml on the server to prevent garbled pages.

Thank you for reading this article carefully. I hope the article "what to do when IDEA starts Tomcat project output garbled" shared by the editor is helpful to everyone. At the same time, I also hope you can support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report