3

IDEA中Tomcat输出中文乱码解决方法

 2 years ago
source link: https://www.huhexian.com/32549.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

IDEA中Tomcat输出中文乱码解决方法

青山 2022-03-1711:48:11评论457字

这篇文章主要介绍了IDEA 启动 Tomcat 项目输出乱码的解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。

IDEA中Tomcat输出中文乱码解决方法解决方法

在 tomcat/conf 目录下,编写 logging.properties ,增加或修改参数以下行,重启后可以了

  1. java.util.logging.ConsoleHandler.encoding = GBK
IDEA中Tomcat输出中文乱码解决方法另外在服务器上tomcat还需要设置 server.xml,将URIEncoding="UTF-8"加入以下行,以防页面出现乱码
  1. <Connector port="8080" protocol="HTTP/1.1"
  2. connectionTimeout="20000"
  3. redirectPort="8443"
  4. URIEncoding="UTF-8" />

IDEA中Tomcat输出中文乱码解决方法

  1. <Connector protocol="AJP/1.3"
  2. address="::1"
  3. port="8009"
  4. redirectPort="8443"
  5. URIEncoding="UTF-8" />

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK