采用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