本文介绍Spring Boot Web开发最常用的配置项
web常用配置项 | 默认值 | 说明 |
---|---|---|
debug | false | 开启/关闭调试模式 |
server.port | 8080 | 服务器脚本 |
server.servlet.context-path | / | 应用上下文 |
spring.http.encoding.charset | utf-8 | 默认字符集编码 |
spring.thymeleaf.cache | true | 开启关闭页面缓存 |
spring.mvc.date-format | 日期输入格式 | |
spring.jackson.date-format | json输出的日期格式 | |
spring.jackson.time-zone | 设置GMT时区 |
server.port=80
debug=false
#/ a , b ,c 三个项目 /地址将产生冲突
#一般情况下,小项目通常都是在Tomcat下部署多个webapp,通过上下文来区分
#在集群或者中大型项目中,通常我们一个Tomcat对应一个webapp,然后通过不同的端口来进行区分(8080/8081/8082)
server.servlet.context-path=/myspringboot
#UTF-8只包含了20000+个中文字符,对于生僻字显示不了
spring.http.encoding.charset=UTF-8
#Spring MVC中对输入参数的格式化
spring.mvc.date-format=yyyy-MM-dd
#设置JSON 日期序列化输出格式,北京时间相对伦敦有8个小时时差所以使用GMT+8
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss SSS
原文:https://www.cnblogs.com/itlaoqi/p/11391709.html