SpringBoot 配置文件 application.properties(二)


mvc

  • spring.mvc.async.request-timeout
    設定async請求的超時時間,以毫秒為單位,如果沒有設置的話,以具體實現的超時時間為准,比如tomcat的servlet3的話是10秒.

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

  • spring.mvc.favicon.enabled
    是否支持favicon.ico,默認為: true

  • spring.mvc.ignore-default-model-on-redirect
    在重定向時是否忽略默認model的內容,默認為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,多個以逗號分隔,如果不加包名的話,默認從classpath路徑開始,默認: messages

  • spring.messages.cache-seconds
    設定加載的資源文件緩存失效時間,-1的話為永不過期,默認為-1

  • spring.messages.encoding
    設定Message bundles的編碼,默認: UTF-8

resource

  • spring.resources.add-mappings
    是否開啟默認的資源處理,默認為true

  • spring.resources.cache-period
    設定資源的緩存時效,以秒為單位.

  • spring.resources.chain.cache
    是否開啟緩存,默認為: true

  • spring.resources.chain.enabled
    是否開啟資源 handling chain,默認為false

  • spring.resources.chain.html-application-cache
    是否開啟h5應用的cache manifest重寫,默認為: false

  • spring.resources.chain.strategy.content.enabled
    是否開啟內容版本策略,默認為false

  • spring.resources.chain.strategy.content.paths
    指定要應用的版本的路徑,多個以逗號分隔,默認為:[/**]

  • spring.resources.chain.strategy.fixed.enabled
    是否開啟固定的版本策略,默認為false

  • spring.resources.chain.strategy.fixed.paths
    指定要應用版本策略的路徑,多個以逗號分隔

  • spring.resources.chain.strategy.fixed.version
    指定版本策略使用的版本號

  • spring.resources.static-locations
    指定靜態資源路徑,默認為classpath:[/META-INF/resources/,/resources/, /static/, /public/]以及context:/

freemarker

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

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

  • spring.freemarker.cache
    是否開啟template caching.

  • spring.freemarker.charset
    設定Template的編碼.

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

  • spring.freemarker.content-type
    設定Content-Type.

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

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

  • spring.freemarker.expose-session-attributes
    設定所有HttpSession的屬性在merge到模板的時候,是否要都添加到model中.

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

  • spring.freemarker.prefer-file-system-access
    是否優先從文件系統加載template,以支持熱加載,默認為true

  • spring.freemarker.prefix
    設定freemarker模板的前綴.

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

  • spring.freemarker.settings
    設定FreeMarker keys.

  • spring.freemarker.suffix
    設定模板的后綴.

  • spring.freemarker.template-loader-path
    設定模板的加載路徑,多個以逗號分隔,默認: ["classpath:/templates/"]

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

velocity

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

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

  • spring.velocity.cache
    是否開啟模板緩存

  • spring.velocity.charset
    設定模板編碼

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

  • spring.velocity.content-type
    設定ContentType的值

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

  • spring.velocity.enabled
    設定是否允許mvc使用velocity

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

  • spring.velocity.expose-session-attributes
    是否在merge模板的時候,將HttpSession屬性都添加到model中

  • spring.velocity.expose-spring-macro-helpers
    設定是否以springMacroRequestContext的名來暴露RequestContext給Spring’s macro類庫使用

  • spring.velocity.number-tool-attribute
    設定暴露給velocity上下文的NumberTool的名

  • spring.velocity.prefer-file-system-access
    是否優先從文件系統加載模板以支持熱加載,默認為true

  • spring.velocity.prefix
    設定velocity模板的前綴.

  • spring.velocity.properties
    設置velocity的額外屬性.

  • spring.velocity.request-context-attribute
    設定RequestContext attribute的名.

  • spring.velocity.resource-loader-path
    設定模板路徑,默認為: classpath:/templates/

  • spring.velocity.suffix
    設定velocity模板的后綴.

  • spring.velocity.toolbox-config-location
    設定Velocity Toolbox配置文件的路徑,比如 /WEB-INF/toolbox.xml.

  • spring.velocity.view-names
    設定需要解析的視圖名稱.

http

  • spring.hateoas.apply-to-primary-object-mapper
    設定是否對object mapper也支持HATEOAS,默認為: true

  • spring.http.converters.preferred-json-mapper
    是否優先使用JSON mapper來轉換.

  • spring.http.encoding.charset
    指定http請求和相應的Charset,默認: UTF-8

  • spring.http.encoding.enabled
    是否開啟http的編碼支持,默認為true

  • spring.http.encoding.force
    是否強制對http請求和響應進行編碼,默認為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會作為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
    指定序列化時屬性的inclusion方式,具體查看JsonInclude.Include枚舉.

  • spring.jackson.time-zone
    指定日期格式化時區,比如America/Los_Angeles或者GMT+10.



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM