欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Spring Boot 配置大全(小結(jié))

 更新時(shí)間:2017年11月16日 11:22:05   作者:Lovnx  
本篇文章主要介紹了Spring Boot 配置大全(小結(jié)),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

Spring Boot 允許通過(guò)外部配置讓你在不同的環(huán)境使用同一應(yīng)用程序的代碼,簡(jiǎn)單說(shuō)就是可以通過(guò)配置文件來(lái)注入屬性或者修改默認(rèn)的配置。

SpringBoot的配置方式有很多,它們的優(yōu)先級(jí)如下所示(優(yōu)先級(jí)遞減順序):

1.命令行參數(shù)
2.來(lái)自java:comp/env的JNDI屬性
3.Java系統(tǒng)屬性(System.getProperties())
4.操作系統(tǒng)環(huán)境變量
5.RandomValuePropertySource配置的random.*屬性值
6.jar包外部的application-{profile}.properties或application.yml(帶spring.profile)配置文件
7.jar包內(nèi)部的application-{profile}.properties或application.yml(帶spring.profile)配置文件
8.jar包外部的application.properties或application.yml(不帶spring.profile)配置文件
9.jar包內(nèi)部的application.properties或application.yml(不帶spring.profile)配置文件
10.@Configuration注解類上的@PropertySource
11.通過(guò)SpringApplication.setDefaultProperties指定的默認(rèn)屬性

mvc

spring.mvc.async.request-timeout
設(shè)定async請(qǐng)求的超時(shí)時(shí)間,以毫秒為單位,如果沒有設(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路徑開始,默認(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
是否開始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
是否開啟默認(rèn)的資源處理,默認(rèn)為true

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

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

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

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

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

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

spring.resources.chain.strategy.fixed.enabled
是否開啟固定的版本策略,默認(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
是否開啟文件上傳支持,默認(rèn)為true

multipart.file-size-threshold
設(shè)定文件寫入磁盤的閾值,單位為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
是否開啟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
是否開啟模板緩存

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
是否開啟模板緩存,默認(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
是否開啟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
是否開啟模板緩存.

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
在寫入declaration header時(shí)使用的編碼

spring.groovy.template.configuration.expand-empty-elements
是使用<br/>這種形式,還是<br></br>這種展開模式,默認(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
是否開啟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
是否開啟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
是否開啟Jackson的反序列化

spring.jackson.generator
是否開啟json的generators.

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

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

spring.jackson.mapper
是否開啟Jackson通用的特性.

spring.jackson.parser
是否開啟jackson的parser特性.

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

spring.jackson.serialization
是否開啟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.

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Spark SQL關(guān)于性能調(diào)優(yōu)選項(xiàng)詳解

    Spark SQL關(guān)于性能調(diào)優(yōu)選項(xiàng)詳解

    這篇文章將為大家詳細(xì)講解有關(guān)Spark SQL性能調(diào)優(yōu)選項(xiàng),小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲
    2023-02-02
  • SpringBoot通過(guò)token實(shí)現(xiàn)用戶互踢功能(具體實(shí)現(xiàn))

    SpringBoot通過(guò)token實(shí)現(xiàn)用戶互踢功能(具體實(shí)現(xiàn))

    所謂token,既用戶能夠在一定時(shí)間內(nèi)證明自己身份的一長(zhǎng)串字符串,這篇文章主要介紹了SpringBoot通過(guò)token實(shí)現(xiàn)用戶互踢功能,需要的朋友可以參考下
    2024-04-04
  • 如何提高java代碼的重用性

    如何提高java代碼的重用性

    在本篇文章中小編給各位分享了關(guān)于如何提高java代碼的重用性的相關(guān)知識(shí)點(diǎn)內(nèi)容,有需要的朋友們參考下。
    2019-07-07
  • Java開發(fā)微信Navicat支付完整版

    Java開發(fā)微信Navicat支付完整版

    這篇文章主要介紹了Java開發(fā)微信Navicat支付完整版,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-08-08
  • MybatisPlus字段類型轉(zhuǎn)換的實(shí)現(xiàn)示例

    MybatisPlus字段類型轉(zhuǎn)換的實(shí)現(xiàn)示例

    本文主要介紹了MybatisPlus如何完成字段類型轉(zhuǎn)換,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2023-03-03
  • 三種Spring BeanName生成器,你了解嗎

    三種Spring BeanName生成器,你了解嗎

    無(wú)論我們是通過(guò) XML 文件,還是 Java 代碼,亦或是包掃描的方式去注冊(cè) Bean,都可以不設(shè)置BeanName,而Spring均會(huì)為之提供默認(rèn)的 beanName,本文我們就來(lái)看看 Spring 中三種處理不同情況的 beanName生成器吧
    2023-09-09
  • Java反射機(jī)制詳解

    Java反射機(jī)制詳解

    Java的反射機(jī)制是在運(yùn)行狀態(tài)中,對(duì)于任何一個(gè)類,都可以知道這個(gè)類的所有屬性和方法,對(duì)于任何一個(gè)對(duì)象,都可以調(diào)用它所有的方法和屬性,修改部分類型信息,這種動(dòng)態(tài)獲取信息以及動(dòng)態(tài)調(diào)用對(duì)象方法的功能稱為Java的反射機(jī)制
    2022-09-09
  • 2020JDK1.8安裝教程詳解(一次就可安裝成功)

    2020JDK1.8安裝教程詳解(一次就可安裝成功)

    這篇文章主要介紹了2020JDK1.8安裝教程詳解(一次就可安裝成功),本文通過(guò)圖文并茂的形式分步驟給大家講解的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧
    2020-08-08
  • Spring整合SpringMVC + Mybatis基礎(chǔ)框架的配置文件詳解

    Spring整合SpringMVC + Mybatis基礎(chǔ)框架的配置文件詳解

    這篇文章主要介紹了Spring整合SpringMVC + Mybatis基礎(chǔ)框架的配置文件,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-02-02
  • Java Unsafe 類的講解

    Java Unsafe 類的講解

    這篇文章主要給大家分享了 Java Unsafe 類的講解,文章圍繞Unsafe 類的相關(guān)資料展開詳細(xì)內(nèi)容,具有一定的參考價(jià)值需要的朋友可以參考一下
    2021-11-11

最新評(píng)論