码迷,mamicode.com
首页 > 移动开发 > 详细

spring-boot application.properties设置最全指南

时间:2018-01-01 16:52:26      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:中文   enc   manage   response   包含   content   support   net   tail   

1、中文乱码问题

  server.tomcat.uri-encoding=UTF-8
  spring.http.encoding.force=true
  spring.http.encoding.enabled=true
  spring.http.encoding.charset=UTF-8

   出现乱码时,首先区分request传过来的是什么编码,然后response返回的是什么编码,再逐一排查。

   具体参考:http://blog.csdn.net/hengyunabc/article/details/17053585###

        http://harttle.land/2016/04/11/http-form-encoding.html

2、设置文件上传大小

spring.http.multipart.maxFileSize=10Mb
spring.http.multipart.maxRequestSize=10Mb

3、请求url包含扩展名,关闭根据扩展名查找资源

web-support.content-negotiation-manager.favorPathExtension = false

4、关闭X-Frame-Options的Header选型

security.headers.frame=false

 

 

PS:持续更新中,敬请期待。。。。

 

spring-boot application.properties设置最全指南

标签:中文   enc   manage   response   包含   content   support   net   tail   

原文地址:https://www.cnblogs.com/jiagoushitanxian/p/8167521.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!