spring boot 中文乱码问题解决

采用yml的方式配置,传统的方法,配置一样只是格式不同而已

# 配置信息
spring:
  redis:
    hostName: 192.168.0.18
    port: 6379    
    password:
    timeout: 0
    pool:
      maxActive: 8    
      maxWait: -1    
      maxIdle: 8    
      minIdle: 0 
  http: 
    encoding:
      force: true
      charset: UTF-8
      enabled: true

server:    
  tomcat:
    uri-encoding: UTF-8

主要加上:

spring:
  http: 
    encoding:
      force: true
      charset: UTF-8
      enabled: true
server:    
  tomcat:
    uri-encoding: UTF-8
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容