MVC for SpringBoot configuration attributes

  spring, springboot

SpringBoot configuration property series

In addition, I attach some personal articles about springboot.

Order

Mainly mvc-related configurations

mvc

  • spring.mvc.async.request-timeout
    Set the timeout period for async requests in milliseconds. if it is not set, the specific timeout period shall prevail, for example, 10 seconds for tomcat servlet3.

  • spring.mvc.date-format
    Set the format of the date, such as DD/mm/yyy.

  • spring.mvc.favicon.enabled
    Whether favicon.ico is supported; the default is: true

  • spring.mvc.ignore-default-model-on-redirect
    Whether to ignore the contents of the default model when redirecting; the default is true

  • spring.mvc.locale
    Specifies the Locale to use.

  • spring.mvc.message-codes-resolver-format
    Specifies the formatting policy for message codes (prefix _ error _ code, postfix _ error _ code).

  • spring.mvc.view.prefix
    Specifies the prefix of the mvc view.

  • spring.mvc.view.suffix
    Specifies the suffix of the mvc view.

messages

  • spring.messages.basename
    Specify basename of message, multiple of which are separated by commas. if the package name is not added, the default is classpath path. the default is messages

  • spring.messages.cache-seconds
    Set the cache expiration time of the loaded resource file to -1, which means it will never expire, and the default value is -1

  • spring.messages.encoding
    Set the encoding of Message bundles, default: UTF-8

mobile

  • spring.mobile.devicedelegatingviewresolver.enable-fallback
    Whether the fallback solution is supported, false by default

  • spring.mobile.devicedelegatingviewresolver.enabled
    Do you want to start device view resolver? the default is: false

  • spring.mobile.devicedelegatingviewresolver.mobile-prefix
    Set the prefix of mobile end view, the default is: mobile/

  • spring.mobile.devicedelegatingviewresolver.mobile-suffix
    Set suffix for mobile view

  • spring.mobile.devicedelegatingviewresolver.normal-prefix
    Sets the view prefix for common devices

  • spring.mobile.devicedelegatingviewresolver.normal-suffix
    Set suffix for normal device view

  • spring.mobile.devicedelegatingviewresolver.tablet-prefix
    Set the tablet view prefix, default: tablet/

  • spring.mobile.devicedelegatingviewresolver.tablet-suffix
    Set the tablet view suffix.

  • spring.mobile.sitepreference.enabled
    Whether SitePreferenceHandler is enabled; the default is: true

view

  • spring.view.prefix
    Set the prefix of mvc view.

  • spring.view.suffix
    Set suffix for mvc view.

resource

  • spring.resources.add-mappings
    Whether to turn on the default resource processing, the default is true

  • spring.resources.cache-period
    Sets the cache age of the resource in seconds.

  • spring.resources.chain.cache
    Whether to open cache, the default is: true

  • spring.resources.chain.enabled
    Whether to open the resource handling chain, the default is false

  • spring.resources.chain.html-application-cache
    Whether to turn on cache manifest override for h5 application, the default is: false

  • spring.resources.chain.strategy.content.enabled
    Whether to turn on the content version policy is false by default

  • spring.resources.chain.strategy.content.paths
    Specify the path of the version to be applied. Multiple paths are separated by commas. The default is: [/* *]

  • spring.resources.chain.strategy.fixed.enabled
    Whether to open a fixed version policy, the default is false

  • spring.resources.chain.strategy.fixed.paths
    Specifies the path to apply the version policy, separated by commas

  • spring.resources.chain.strategy.fixed.version
    Specifies the version number used by the version policy

  • spring.resources.static-locations
    Specifies the static resource path, which defaults to classpath: [/meta-inf/resources/,/resources/,/static/,/public/] and context:/

multipart

  • multipart.enabled
    Whether to turn on file upload support, the default is true

  • multipart.file-size-threshold
    Set the threshold for writing files to disk, in MB or KB, with a default of 0

  • multipart.location
    Specify the file upload path.

  • multipart.max-file-size
    Specifies the maximum file size, which defaults to 1MB.

  • multipart.max-request-size
    Specifies the maximum value for each request, which defaults to 10MB.

freemarker

  • spring.freemarker.allow-request-override
    Specifies whether the attribute of HttpServletRequest can override the same name item of the controller’s model.

  • spring.freemarker.allow-session-override
    Specifies whether the HttpSession property can override the controller’s model entry with the same name.

  • spring.freemarker.cache
    Whether to open template caching.

  • spring.freemarker.charset
    Set the encoding of Template.

  • spring.freemarker.check-template-location
    Check if templates path exists.

  • spring.freemarker.content-type
    Set Content-Type.

  • spring.freemarker.enabled
    Whether to allow mvc to use freemarker.

  • spring.freemarker.expose-request-attributes
    Set whether all request attributes should be added to the model when merge into the template.

  • spring.freemarker.expose-session-attributes
    Set whether all HttpSession attributes should be added to the model when merge into the template.

  • spring.freemarker.expose-spring-macro-helpers
    Sets whether the RequestContext is exposed in the form of springMacroRequestContext for use by Spring’s macro library.

  • spring.freemarker.prefer-file-system-access
    Whether to preferentially load template from the file system to support hot loading; the default is true

  • spring.freemarker.prefix
    Set the prefix of freemarker template.

  • spring.freemarker.request-context-attribute
    Specifies the name of the RequestContext property.

  • spring.freemarker.settings
    Set FreeMarker keys.

  • spring.freemarker.suffix
    Set the suffix of the template.

  • spring.freemarker.template-loader-path
    Set the loading path of templates, multiple of which are separated by commas, default: [“classpath:/templates/”]

  • spring.freemarker.view-names
    Specifies the list of views that use templates.

velocity

  • spring.velocity.allow-request-override
    Specifies whether the attribute of HttpServletRequest can override the same name item of the controller’s model.

  • spring.velocity.allow-session-override
    Specifies whether the HttpSession property can override the controller’s model entry with the same name.

  • spring.velocity.cache
    Do you want to open the template cache

  • spring.velocity.charset
    Set template code

  • spring.velocity.check-template-location
    Whether to check whether the template path exists.

  • spring.velocity.content-type
    Sets the value of ContentType

  • spring.velocity.date-tool-attribute
    Sets the name of the DateTool that is exposed to the velocity context.

  • spring.velocity.enabled
    Set whether mvc is allowed to use velocity

  • spring.velocity.expose-request-attributes
    Whether to add the request attribute to the model when merge the template

  • spring.velocity.expose-session-attributes
    Whether to add the HttpSession attribute to the model when merge the template

  • spring.velocity.expose-spring-macro-helpers
    Sets whether the RequestContext is exposed under the name springMacroRequestContext for use by the Spring’s macro class library.

  • spring.velocity.number-tool-attribute
    Sets the name of NumberTool that is exposed to the velocity context

  • spring.velocity.prefer-file-system-access
    Whether to preferentially load templates from the file system to support hot loading, the default is true

  • spring.velocity.prefix
    Set the prefix of velocity template.

  • spring.velocity.properties
    Set additional velocity attributes.

  • spring.velocity.request-context-attribute
    Set the name of RequestContext attribute.

  • spring.velocity.resource-loader-path
    Set the template path, the default is: classpath:/templates/

  • spring.velocity.suffix
    Set suffix for velocity template.

  • spring.velocity.toolbox-config-location
    Set the path to the Velocity Toolbox configuration file, such as/webinf/toolbox.xml.

  • spring.velocity.view-names
    Set the name of the view to be resolved.

thymeleaf

  • spring.thymeleaf.cache
    Whether to open the template cache, the default is true

  • spring.thymeleaf.check-template-location
    Whether to check whether the template path exists, the default is true

  • spring.thymeleaf.content-type
    Specifies the Content-Type and defaults to text/html

  • spring.thymeleaf.enabled
    Whether MVC is allowed to use Thymeleaf, the default is: true

  • spring.thymeleaf.encoding
    Specifies the encoding of the template; the default is UTF-8

  • spring.thymeleaf.excluded-view-names
    Specifies the name of the view that does not use templates, separated by commas.

  • spring.thymeleaf.mode
    Specifies the mode of the template, specifically viewing StandardTemplateModeHandlers. The default is HTML5

  • spring.thymeleaf.prefix
    Specifies the prefix of the template, which defaults to: classpath:/templates/

  • spring.thymeleaf.suffix
    Specifies the suffix of the template, which defaults to:. html

  • spring.thymeleaf.template-resolver-order
    Specifies the parsing order of the template, which defaults to the first.

  • spring.thymeleaf.view-names
    Specifies the name of the view using the template, separated by commas.

mustcache

  • spring.mustache.cache
    Whether to Enable template caching.

  • spring.mustache.charset
    Specifies the encoding of Template.

  • spring.mustache.check-template-location
    Whether to check whether the default path exists.

  • spring.mustache.content-type
    Specify Content-Type.

  • spring.mustache.enabled
    Whether to turn on template support for mustcache.

  • spring.mustache.prefix
    Specifies the prefix of the template, default: classpath:/templates/

  • spring.mustache.suffix
    Specifies the suffix of the template, default:. html

  • spring.mustache.view-names
    Specify the view name to use the template.

Groovy template

  • spring.groovy.template.allow-request-override
    Specifies whether the attribute of HttpServletRequest can override the same name item of the controller’s model.

  • spring.groovy.template.allow-session-override
    Specifies whether the HttpSession property can override the controller’s model entry with the same name.

  • spring.groovy.template.cache
    Whether to open the template cache.

  • spring.groovy.template.charset
    Specifies the Template encoding.

  • spring.groovy.template.check-template-location
    Check whether the path to the template exists.

  • spring.groovy.template.configuration.auto-escape
    Whether to automatically check the variables of model when rendering the template; the default is: false

  • spring.groovy.template.configuration.auto-indent
    Whether to indent automatically when rendering the template, the default is false

  • spring.groovy.template.configuration.auto-indent-string
    If automatic indenting is enabled, is SPACES or TAB used? The default is SPACES

  • spring.groovy.template.configuration.auto-new-line
    Whether to output line breaks when rendering the template is false by default

  • spring.groovy.template.configuration.base-template-class
    Specifies template base class.

  • spring.groovy.template.configuration.cache-templates
    Whether to cache templates, the default is true

  • spring.groovy.template.configuration.declaration-encoding
    The encoding used when writing the declaration header

  • spring.groovy.template.configuration.expand-empty-elements
    Is to use<br/>This form, or<br></br>This expansion mode defaults to false)

  • spring.groovy.template.configuration.locale
    Specify template locale.

  • spring.groovy.template.configuration.new-line-string
    When word wrap is enabled, the output of the word wrap defaults to the value of the line.separator property of the system.

  • spring.groovy.template.configuration.resource-loader-path
    Specifies groovy’s template path, which defaults to classpath:/templates/

  • spring.groovy.template.configuration.use-double-quotes
    Specifies whether the attribute should use double quotation marks or single quotation marks; the default is false

  • spring.groovy.template.content-type
    Specify Content-Type.

  • spring.groovy.template.enabled
    Whether to turn on groovy template support.

  • spring.groovy.template.expose-request-attributes
    Set whether all request attributes should be added to the model when merge into the template.

  • spring.groovy.template.expose-session-attributes
    Set whether all request attributes should be added to the model when merge into the template.

  • spring.groovy.template.expose-spring-macro-helpers
    Sets whether the RequestContext is exposed in the form of springMacroRequestContext for use by Spring’s macro library.

  • spring.groovy.template.prefix
    Specifies the prefix of the template.

  • spring.groovy.template.request-context-attribute
    Specifies the name of the RequestContext property.

  • spring.groovy.template.resource-loader-path
    Specifies the path of the template, which defaults to: classpath:/templates/

  • spring.groovy.template.suffix
    Specifies the suffix of the template

  • spring.groovy.template.view-names
    Specify the name of the view to use the template.

http

  • spring.hateoas.apply-to-primary-object-mapper
    Sets whether HATEOAS is also supported for object mapper; the default is: true

  • spring.http.converters.preferred-json-mapper
    Whether JSON mapper is preferred for conversion.

  • spring.http.encoding.charset
    Specify http request and corresponding Charset, default: UTF-8

  • spring.http.encoding.enabled
    Whether to turn on encoding support for http; the default is true

  • spring.http.encoding.force
    Whether http requests and responses are forced to be encoded is true by default

json

  • spring.jackson.date-format
    Specify a date format, such as yyy-mm-ddhh: mm: ss, or the fully qualified name of a specific format class

  • spring.jackson.deserialization
    Whether to turn on deserialization of Jackson

  • spring.jackson.generator
    Whether to turn on json generators.

  • spring.jackson.joda-date-time-format
    Specify the format of Joda date/time, such as yyyy-MM-dd HH:mm:ss). if not configured, dateformat will be used as backup.

  • spring.jackson.locale
    Specifies the Locale used by json.

  • spring.jackson.mapper
    Whether to turn on Jackson’s general features.

  • spring.jackson.parser
    Whether to turn on jackson’s parser feature.

  • spring.jackson.property-naming-strategy
    Specify PropertyNameStrategy (CAMEL _ CASE _ TO _ LOWER _ CASE _ WITh _ UNDERSCORES) or specify the fully qualified class name of the PropertyNameStrategy subclass.

  • spring.jackson.serialization
    Whether to turn on jackson’s serialization.

  • spring.jackson.serialization-inclusion
    Specifies the inclusion method of the property during serialization, and specifically looks at JsonInclude.Include enumeration.

  • spring.jackson.time-zone
    Specify a date format time zone, such as America/Los_Angeles or GMT+10.

jersey

  • spring.jersey.filter.order
    Specifies the order of the Jersey filter, which defaults to: 0

  • spring.jersey.init
    Specifies the initialization parameter passed to Jersey.

  • spring.jersey.type
    Specify the integration type of Jersey, which can be servlet or filter.