Spring Boot配置總覽

mvc

spring.mvc.async.request-timeout設(shè)定async請(qǐng)求的超時(shí)時(shí)間芝囤,以毫秒為單位,如果沒(méi)有設(shè)置的話,以具體實(shí)現(xiàn)的超時(shí)時(shí)間為準(zhǔn)雕旨,比如tomcat的servlet3的話是10秒.

spring.mvc.date-format設(shè)定日期的格式,比如dd/MM/yyyy.

spring.mvc.favicon.enabled是否支持favicon.ico捧请,默認(rèn)為: true

spring.mvc.ignore-default-model-on-redirect在重定向時(shí)是否忽略默認(rèn)model的內(nèi)容凡涩,默認(rèn)為true

spring.mvc.locale指定使用的Locale.

spring.mvc.message-codes-resolver-format指定message codes的格式化策略(PREFIX_ERROR_CODE,POSTFIX_ERROR_CODE).

spring.mvc.view.prefix指定mvc視圖的前綴.

spring.mvc.view.suffix指定mvc視圖的后綴.

messages

spring.messages.basename指定message的basename,多個(gè)以逗號(hào)分隔疹蛉,如果不加包名的話活箕,默認(rèn)從classpath路徑開(kāi)始,默認(rèn): messages

spring.messages.cache-seconds設(shè)定加載的資源文件緩存失效時(shí)間可款,-1的話為永不過(guò)期育韩,默認(rèn)為-1

spring.messages.encoding設(shè)定Message bundles的編碼,默認(rèn): UTF-8

mobile

spring.mobile.devicedelegatingviewresolver.enable-fallback是否支持fallback的解決方案闺鲸,默認(rèn)false

spring.mobile.devicedelegatingviewresolver.enabled是否開(kāi)始device view resolver筋讨,默認(rèn)為: false

spring.mobile.devicedelegatingviewresolver.mobile-prefix設(shè)定mobile端視圖的前綴,默認(rèn)為:mobile/

spring.mobile.devicedelegatingviewresolver.mobile-suffix設(shè)定mobile視圖的后綴

spring.mobile.devicedelegatingviewresolver.normal-prefix設(shè)定普通設(shè)備的視圖前綴

spring.mobile.devicedelegatingviewresolver.normal-suffix設(shè)定普通設(shè)備視圖的后綴

spring.mobile.devicedelegatingviewresolver.tablet-prefix設(shè)定平板設(shè)備視圖前綴摸恍,默認(rèn):tablet/

spring.mobile.devicedelegatingviewresolver.tablet-suffix設(shè)定平板設(shè)備視圖后綴.

spring.mobile.sitepreference.enabled是否啟用SitePreferenceHandler悉罕,默認(rèn)為: true

view

spring.view.prefix設(shè)定mvc視圖的前綴.

spring.view.suffix設(shè)定mvc視圖的后綴.

resource

spring.resources.add-mappings是否開(kāi)啟默認(rèn)的資源處理,默認(rèn)為true

spring.resources.cache-period設(shè)定資源的緩存時(shí)效立镶,以秒為單位.

spring.resources.chain.cache是否開(kāi)啟緩存壁袄,默認(rèn)為: true

spring.resources.chain.enabled是否開(kāi)啟資源 handling chain,默認(rèn)為false

spring.resources.chain.html-application-cache是否開(kāi)啟h5應(yīng)用的cache manifest重寫(xiě)谜慌,默認(rèn)為: false

spring.resources.chain.strategy.content.enabled是否開(kāi)啟內(nèi)容版本策略然想,默認(rèn)為false

spring.resources.chain.strategy.content.paths指定要應(yīng)用的版本的路徑,多個(gè)以逗號(hào)分隔欣范,默認(rèn)為:[/**]

spring.resources.chain.strategy.fixed.enabled是否開(kāi)啟固定的版本策略变泄,默認(rèn)為false

spring.resources.chain.strategy.fixed.paths指定要應(yīng)用版本策略的路徑,多個(gè)以逗號(hào)分隔

spring.resources.chain.strategy.fixed.version指定版本策略使用的版本號(hào)

spring.resources.static-locations指定靜態(tài)資源路徑恼琼,默認(rèn)為classpath:[/META-INF/resources/,/resources/, /static/, /public/]以及context:/

multipart

multipart.enabled是否開(kāi)啟文件上傳支持妨蛹,默認(rèn)為true

multipart.file-size-threshold設(shè)定文件寫(xiě)入磁盤(pán)的閾值,單位為MB或KB晴竞,默認(rèn)為0

multipart.location指定文件上傳路徑.

multipart.max-file-size指定文件大小最大值蛙卤,默認(rèn)1MB

multipart.max-request-size指定每次請(qǐng)求的最大值,默認(rèn)為10MB

freemarker

spring.freemarker.allow-request-override指定HttpServletRequest的屬性是否可以覆蓋controller的model的同名項(xiàng)

spring.freemarker.allow-session-override指定HttpSession的屬性是否可以覆蓋controller的model的同名項(xiàng)

spring.freemarker.cache是否開(kāi)啟template caching.

spring.freemarker.charset設(shè)定Template的編碼.

spring.freemarker.check-template-location是否檢查templates路徑是否存在.

spring.freemarker.content-type設(shè)定Content-Type.

spring.freemarker.enabled是否允許mvc使用freemarker.

spring.freemarker.expose-request-attributes設(shè)定所有request的屬性在merge到模板的時(shí)候,是否要都添加到model中.

spring.freemarker.expose-session-attributes設(shè)定所有HttpSession的屬性在merge到模板的時(shí)候颤难,是否要都添加到model中.

spring.freemarker.expose-spring-macro-helpers設(shè)定是否以springMacroRequestContext的形式暴露RequestContext給Spring’s macro library使用

spring.freemarker.prefer-file-system-access是否優(yōu)先從文件系統(tǒng)加載template神年,以支持熱加載,默認(rèn)為true

spring.freemarker.prefix設(shè)定freemarker模板的前綴.

spring.freemarker.request-context-attribute指定RequestContext屬性的名.

spring.freemarker.settings設(shè)定FreeMarker keys.

spring.freemarker.suffix設(shè)定模板的后綴.

spring.freemarker.template-loader-path設(shè)定模板的加載路徑行嗤,多個(gè)以逗號(hào)分隔已日,默認(rèn): [“classpath:/templates/”]

spring.freemarker.view-names指定使用模板的視圖列表.

velocity

spring.velocity.allow-request-override指定HttpServletRequest的屬性是否可以覆蓋controller的model的同名項(xiàng)

spring.velocity.allow-session-override指定HttpSession的屬性是否可以覆蓋controller的model的同名項(xiàng)

spring.velocity.cache是否開(kāi)啟模板緩存

spring.velocity.charset設(shè)定模板編碼

spring.velocity.check-template-location是否檢查模板路徑是否存在.

spring.velocity.content-type設(shè)定ContentType的值

spring.velocity.date-tool-attribute設(shè)定暴露給velocity上下文使用的DateTool的名

spring.velocity.enabled設(shè)定是否允許mvc使用velocity

spring.velocity.expose-request-attributes是否在merge模板的時(shí)候,將request屬性都添加到model中

spring.velocity.expose-session-attributes是否在merge模板的時(shí)候栅屏,將HttpSession屬性都添加到model中

spring.velocity.expose-spring-macro-helpers設(shè)定是否以springMacroRequestContext的名來(lái)暴露RequestContext給Spring’s macro類庫(kù)使用

spring.velocity.number-tool-attribute設(shè)定暴露給velocity上下文的NumberTool的名

spring.velocity.prefer-file-system-access是否優(yōu)先從文件系統(tǒng)加載模板以支持熱加載飘千,默認(rèn)為true

spring.velocity.prefix設(shè)定velocity模板的前綴.

spring.velocity.properties設(shè)置velocity的額外屬性.

spring.velocity.request-context-attribute設(shè)定RequestContext attribute的名.

spring.velocity.resource-loader-path設(shè)定模板路徑,默認(rèn)為: classpath:/templates/

spring.velocity.suffix設(shè)定velocity模板的后綴.

spring.velocity.toolbox-config-location設(shè)定Velocity Toolbox配置文件的路徑栈雳,比如 /WEB-INF/toolbox.xml.

spring.velocity.view-names設(shè)定需要解析的視圖名稱.

thymeleaf

spring.thymeleaf.cache是否開(kāi)啟模板緩存护奈,默認(rèn)true

spring.thymeleaf.check-template-location是否檢查模板路徑是否存在,默認(rèn)true

spring.thymeleaf.content-type指定Content-Type哥纫,默認(rèn)為: text/html

spring.thymeleaf.enabled是否允許MVC使用Thymeleaf霉旗,默認(rèn)為: true

spring.thymeleaf.encoding指定模板的編碼,默認(rèn)為: UTF-8

spring.thymeleaf.excluded-view-names指定不使用模板的視圖名稱磺箕,多個(gè)以逗號(hào)分隔.

spring.thymeleaf.mode指定模板的模式奖慌,具體查看StandardTemplateModeHandlers,默認(rèn)為: HTML5

spring.thymeleaf.prefix指定模板的前綴松靡,默認(rèn)為:classpath:/templates/

spring.thymeleaf.suffix指定模板的后綴简僧,默認(rèn)為:.html

spring.thymeleaf.template-resolver-order指定模板的解析順序,默認(rèn)為第一個(gè).

spring.thymeleaf.view-names指定使用模板的視圖名雕欺,多個(gè)以逗號(hào)分隔.

mustcache

spring.mustache.cache是否Enable template caching.

spring.mustache.charset指定Template的編碼.

spring.mustache.check-template-location是否檢查默認(rèn)的路徑是否存在.

spring.mustache.content-type指定Content-Type.

spring.mustache.enabled是否開(kāi)啟mustcache的模板支持.

spring.mustache.prefix指定模板的前綴岛马,默認(rèn): classpath:/templates/

spring.mustache.suffix指定模板的后綴,默認(rèn): .html

spring.mustache.view-names指定要使用模板的視圖名.

groovy模板

spring.groovy.template.allow-request-override指定HttpServletRequest的屬性是否可以覆蓋controller的model的同名項(xiàng)

spring.groovy.template.allow-session-override指定HttpSession的屬性是否可以覆蓋controller的model的同名項(xiàng)

spring.groovy.template.cache是否開(kāi)啟模板緩存.

spring.groovy.template.charset指定Template編碼.

spring.groovy.template.check-template-location是否檢查模板的路徑是否存在.

spring.groovy.template.configuration.auto-escape是否在渲染模板時(shí)自動(dòng)排查model的變量屠列,默認(rèn)為: false

spring.groovy.template.configuration.auto-indent是否在渲染模板時(shí)自動(dòng)縮進(jìn)啦逆,默認(rèn)為false

spring.groovy.template.configuration.auto-indent-string如果自動(dòng)縮進(jìn)啟用的話,是使用SPACES還是TAB笛洛,默認(rèn)為: SPACES

spring.groovy.template.configuration.auto-new-line渲染模板時(shí)是否要輸出換行夏志,默認(rèn)為false

spring.groovy.template.configuration.base-template-class指定template base class.

spring.groovy.template.configuration.cache-templates是否要緩存模板,默認(rèn)為true

spring.groovy.template.configuration.declaration-encoding在寫(xiě)入declaration header時(shí)使用的編碼

spring.groovy.template.configuration.expand-empty-elements是使用

這種形式苛让,還是
</br>
這種展開(kāi)模式沟蔑,默認(rèn)為: false)

spring.groovy.template.configuration.locale指定template locale.

spring.groovy.template.configuration.new-line-string當(dāng)啟用自動(dòng)換行時(shí),換行的輸出狱杰,默認(rèn)為系統(tǒng)的line.separator屬性的值

spring.groovy.template.configuration.resource-loader-path指定groovy的模板路徑瘦材,默認(rèn)為classpath:/templates/

spring.groovy.template.configuration.use-double-quotes指定屬性要使用雙引號(hào)還是單引號(hào),默認(rèn)為false

spring.groovy.template.content-type指定Content-Type.

spring.groovy.template.enabled是否開(kāi)啟groovy模板的支持.

spring.groovy.template.expose-request-attributes設(shè)定所有request的屬性在merge到模板的時(shí)候仿畸,是否要都添加到model中.

spring.groovy.template.expose-session-attributes設(shè)定所有request的屬性在merge到模板的時(shí)候食棕,是否要都添加到model中.

spring.groovy.template.expose-spring-macro-helpers設(shè)定是否以springMacroRequestContext的形式暴露RequestContext給Spring’s macro library使用

spring.groovy.template.prefix指定模板的前綴.

spring.groovy.template.request-context-attribute指定RequestContext屬性的名.

spring.groovy.template.resource-loader-path指定模板的路徑朗和,默認(rèn)為: classpath:/templates/

spring.groovy.template.suffix指定模板的后綴

spring.groovy.template.view-names指定要使用模板的視圖名稱.

http

spring.hateoas.apply-to-primary-object-mapper設(shè)定是否對(duì)object mapper也支持HATEOAS,默認(rèn)為: true

spring.http.converters.preferred-json-mapper是否優(yōu)先使用JSON mapper來(lái)轉(zhuǎn)換.

spring.http.encoding.charset指定http請(qǐng)求和相應(yīng)的Charset簿晓,默認(rèn): UTF-8

spring.http.encoding.enabled是否開(kāi)啟http的編碼支持眶拉,默認(rèn)為true

spring.http.encoding.force是否強(qiáng)制對(duì)http請(qǐng)求和響應(yīng)進(jìn)行編碼,默認(rèn)為true

json

spring.jackson.date-format指定日期格式抢蚀,比如yyyy-MM-dd HH:mm:ss镀层,或者具體的格式化類的全限定名

spring.jackson.deserialization是否開(kāi)啟Jackson的反序列化

spring.jackson.generator是否開(kāi)啟json的generators.

spring.jackson.joda-date-time-format指定Joda date/time的格式镰禾,比如yyyy-MM-dd HH:mm:ss). 如果沒(méi)有配置的話皿曲,dateformat會(huì)作為backup

spring.jackson.locale指定json使用的Locale.

spring.jackson.mapper是否開(kāi)啟Jackson通用的特性.

spring.jackson.parser是否開(kāi)啟jackson的parser特性.

spring.jackson.property-naming-strategy指定PropertyNamingStrategy (CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES)或者指定PropertyNamingStrategy子類的全限定類名.

spring.jackson.serialization是否開(kāi)啟jackson的序列化.

spring.jackson.serialization-inclusion指定序列化時(shí)屬性的inclusion方式,具體查看JsonInclude.Include枚舉.

spring.jackson.time-zone指定日期格式化時(shí)區(qū)吴侦,比如America/Los_Angeles或者GMT+10.

jersey

spring.jersey.filter.order指定Jersey filter的order屋休,默認(rèn)為: 0

spring.jersey.init指定傳遞給Jersey的初始化參數(shù).

spring.jersey.type指定Jersey的集成類型,可以是servlet或者filter.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末备韧,一起剝皮案震驚了整個(gè)濱河市劫樟,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌织堂,老刑警劉巖叠艳,帶你破解...
    沈念sama閱讀 216,372評(píng)論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異易阳,居然都是意外死亡附较,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門(mén)潦俺,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)拒课,“玉大人,你說(shuō)我怎么就攤上這事事示≡缦瘢” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 162,415評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵肖爵,是天一觀的道長(zhǎng)卢鹦。 經(jīng)常有香客問(wèn)我,道長(zhǎng)劝堪,這世上最難降的妖魔是什么冀自? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,157評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮幅聘,結(jié)果婚禮上凡纳,老公的妹妹穿的比我還像新娘。我一直安慰自己帝蒿,他們只是感情好荐糜,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,171評(píng)論 6 388
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著,像睡著了一般暴氏。 火紅的嫁衣襯著肌膚如雪延塑。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 51,125評(píng)論 1 297
  • 那天答渔,我揣著相機(jī)與錄音关带,去河邊找鬼。 笑死沼撕,一個(gè)胖子當(dāng)著我的面吹牛宋雏,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播务豺,決...
    沈念sama閱讀 40,028評(píng)論 3 417
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼磨总,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了笼沥?” 一聲冷哼從身側(cè)響起蚪燕,我...
    開(kāi)封第一講書(shū)人閱讀 38,887評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎奔浅,沒(méi)想到半個(gè)月后馆纳,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,310評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡汹桦,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,533評(píng)論 2 332
  • 正文 我和宋清朗相戀三年鲁驶,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片营勤。...
    茶點(diǎn)故事閱讀 39,690評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡灵嫌,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出葛作,到底是詐尸還是另有隱情寿羞,我是刑警寧澤,帶...
    沈念sama閱讀 35,411評(píng)論 5 343
  • 正文 年R本政府宣布赂蠢,位于F島的核電站绪穆,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏虱岂。R本人自食惡果不足惜玖院,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,004評(píng)論 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望第岖。 院中可真熱鬧难菌,春花似錦、人聲如沸蔑滓。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,659評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至燎窘,卻和暖如春摹闽,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背褐健。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,812評(píng)論 1 268
  • 我被黑心中介騙來(lái)泰國(guó)打工付鹿, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人蚜迅。 一個(gè)月前我還...
    沈念sama閱讀 47,693評(píng)論 2 368
  • 正文 我出身青樓舵匾,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親慢叨。 傳聞我的和親對(duì)象是個(gè)殘疾皇子纽匙,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,577評(píng)論 2 353

推薦閱讀更多精彩內(nèi)容