Springboot Common Configuration

Source: Internet
Author: User
Tags locale serialization

Preface: Springboot integrates the mainstream third-party framework, but needs to use the Springboot set of configuration methods. But I just listed here is very very commonly used, you can see the post of several blog, slowly will add. Of course, the official document also has a corresponding configuration, unfortunately there is no comment.

Mvc
    • Spring.mvc.async.request-timeout
      Sets the timeout for the async request, in milliseconds, if not set, whichever is the specific implementation timeout, such as Tomcat's Servlet3 10 seconds.

    • Spring.mvc.date-format
      Format dates, such as dd/mm/yyyy.

    • Spring.mvc.favicon.enabled
      Whether Favicon.ico is supported, default is: True

    • Spring.mvc.ignore-default-model-on-redirect
      Whether to ignore the contents of the default model when redirecting, by default True

    • Spring.mvc.locale
      Specifies the locale to use.

    • Spring.mvc.message-codes-resolver-format
      Specifies the format policy (prefix_error_code,postfix_error_code) for message codes.

    • Spring.mvc.view.prefix
      Specifies the prefix for the MVC view.

    • Spring.mvc.view.suffix
      Specifies the suffix of the MVC view.

Messages
    • Spring.messages.basename
      Specifies the basename of the message, separated by commas, and, if no package name is added, by default from the Classpath path, default: Messages

    • Spring.messages.cache-seconds
      Set the cache expiration time for the loaded resource file, 1 for never expiring, 1 by default

    • Spring.messages.encoding
      Set the encoding of message bundles, default: UTF-8

Mobile
  • Spring.mobile.devicedelegatingviewresolver.enable-fallback
    If the fallback solution is supported, the default is False

  • Spring.mobile.devicedelegatingviewresolver.enabled
    Whether to start Device View resolver, the default is: false

  • Spring.mobile.devicedelegatingviewresolver.mobile-prefix
    Set the prefix for the mobile view by default: mobile/

  • Spring.mobile.devicedelegatingviewresolver.mobile-suffix
    Set the suffix of the mobile view

  • Spring.mobile.devicedelegatingviewresolver.normal-prefix
    Set the view prefix for a normal device

  • Spring.mobile.devicedelegatingviewresolver.normal-suffix
    To set the suffix of a normal device view

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

  • Spring.mobile.devicedelegatingviewresolver.tablet-suffix
    Sets the tablet view suffix.

  • Spring.mobile.sitepreference.enabled
    If Sitepreferencehandler is enabled, the default is: True

View
    • Spring.view.prefix
      Sets the prefix for the MVC view.

    • Spring.view.suffix
      Sets the suffix of the MVC view.

Resource
  • Spring.resources.add-mappings
    Whether to turn on default resource handling, which is true by default

  • Spring.resources.cache-period
    Sets the cache aging of the resource, in seconds.

  • Spring.resources.chain.cache
    Whether to turn on caching, by default: True

  • Spring.resources.chain.enabled
    Whether to turn on resource handling chain, default to False

  • Spring.resources.chain.html-application-cache
    Whether to turn on cache manifest overrides for the H5 app, default to: False

  • Spring.resources.chain.strategy.content.enabled
    Whether to turn on content versioning policy, default to False

  • Spring.resources.chain.strategy.content.paths
    Specifies the path to the version to apply, separated by commas, by default: [/**]

  • Spring.resources.chain.strategy.fixed.enabled
    Whether to turn on fixed version policy, default to False

  • Spring.resources.chain.strategy.fixed.paths
    Specifies the path to which the version policy is to be applied, with multiple comma-delimited

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

  • Spring.resources.static-locations
    Specify a static resource path, default is classpath:[/meta-inf/resources/,/resources/,/static/,/public/], and context:/

Multipart
    • Multipart.enabled
      Whether to turn on file upload support, true by default

    • Multipart.file-size-threshold
      Sets the threshold for file writes to disk, in megabytes or KB, and defaults to 0

    • Multipart.location
      Specifies the file upload path.

    • Multipart.max-file-size
      Specify maximum file size, default 1MB

    • Multipart.max-request-size
      Specifies the maximum value per request, which defaults to 10MB

Freemarker
  • Spring.freemarker.allow-request-override
    Specifies whether the HttpServletRequest property can overwrite an item with the same name as the controller's model

  • Spring.freemarker.allow-session-override
    Specifies whether the HttpSession property can overwrite an item with the same name as the controller's model

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

  • Spring.freemarker.charset
    Sets the encoding of the template.

  • Spring.freemarker.check-template-location
    Whether to check if the templates path exists.

  • Spring.freemarker.content-type
    Set the Content-type.

  • Spring.freemarker.enabled
    Whether MVC is allowed to use Freemarker.

  • Spring.freemarker.expose-request-attributes
    Sets all request properties to be added to the model when the merge is in the template.

  • Spring.freemarker.expose-session-attributes
    Sets all httpsession properties to be added to the model when the merge is in the template.

  • Spring.freemarker.expose-spring-macro-helpers
    Set whether to expose RequestContext to spring's macro library in the form of Springmacrorequestcontext

  • Spring.freemarker.prefer-file-system-access
    Whether to load the template from the file system first to support hot loading, by default True

  • Spring.freemarker.prefix
    Sets the prefix for the freemarker template.

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

  • Spring.freemarker.settings
    Set Freemarker keys.

  • Spring.freemarker.suffix
    Sets the suffix of the template.

  • Spring.freemarker.template-loader-path
    Sets the load path for the template, separated by commas, by default: ["classpath:/templates/"]

  • Spring.freemarker.view-names
    Specifies a list of views that use a template.

Velocity
  • Spring.velocity.allow-request-override
    Specifies whether the HttpServletRequest property can overwrite an item with the same name as the controller's model

  • Spring.velocity.allow-session-override
    Specifies whether the HttpSession property can overwrite an item with the same name as the controller's model

  • Spring.velocity.cache
    Whether to open the template cache

  • Spring.velocity.charset
    Set Template encoding

  • Spring.velocity.check-template-location
    Whether to check if the template path exists.

  • Spring.velocity.content-type
    Set the value of the ContentType

  • Spring.velocity.date-tool-attribute
    Sets the name of the Datetool exposed to the velocity context

  • Spring.velocity.enabled
    Set whether MVC is allowed to use velocity

  • Spring.velocity.expose-request-attributes
    Whether the request property is added to the model when the merge template is in

  • Spring.velocity.expose-session-attributes
    Whether to add the HttpSession property to the model when the merge template is in

  • Spring.velocity.expose-spring-macro-helpers
    Set whether to expose RequestContext to spring's macro class library in the name of Springmacrorequestcontext

  • Spring.velocity.number-tool-attribute
    Sets the name of the Numbertool exposed to the velocity context

  • Spring.velocity.prefer-file-system-access
    Whether to load the template from the file system first to support hot load, default to True

  • Spring.velocity.prefix
    Sets the prefix for the velocity template.

  • Spring.velocity.properties
    Sets the additional properties of velocity.

  • Spring.velocity.request-context-attribute
    Sets the name of the RequestContext attribute.

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

  • Spring.velocity.suffix
    Sets the suffix of the velocity template.

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

  • Spring.velocity.view-names
    Sets the name of the view that needs to be resolved.

Thymeleaf
  • Spring.thymeleaf.cache
    Whether to turn on template caching, by default True

  • Spring.thymeleaf.check-template-location
    Whether to check if the template path exists, by default true

  • Spring.thymeleaf.content-type
    Specify Content-type, which defaults to: text/html

  • Spring.thymeleaf.enabled
    Allow MVC to use Thymeleaf, default: True

  • Spring.thymeleaf.encoding
    Specifies the encoding of the template, which defaults to: UTF-8

  • Spring.thymeleaf.excluded-view-names
    Specifies the name of the view that does not use a template, separated by commas.

  • Spring.thymeleaf.mode
    Specify the mode of the template, see Standardtemplatemodehandlers, default to: HTML5

  • Spring.thymeleaf.prefix
    Specifies the prefix for 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 parse order of the template, which defaults to the first one.

  • 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 the template.

    • Spring.mustache.check-template-location
      Whether to check if the default path exists.

    • Spring.mustache.content-type
      Specifies Content-type.

    • Spring.mustache.enabled
      Whether to turn on Mustcache template support.

    • 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
      Specifies the name of the view to use for the template.

Groovy Templates
  • Spring.groovy.template.allow-request-override
    Specifies whether the HttpServletRequest property can overwrite an item with the same name as the controller's model

  • Spring.groovy.template.allow-session-override
    Specifies whether the HttpSession property can overwrite an item with the same name as the controller's model

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

  • Spring.groovy.template.charset
    Specifies the template encoding.

  • Spring.groovy.template.check-template-location
    Whether to check if the path to the template exists.

  • Spring.groovy.template.configuration.auto-escape
    Whether to automatically troubleshoot model variables when rendering a template, by default: false

  • Spring.groovy.template.configuration.auto-indent
    Whether to automatically indent when the template is rendered, false by default

  • Spring.groovy.template.configuration.auto-indent-string
    If Auto indent is enabled, whether to use SPACES or tab, the default is: SPACES

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

  • Spring.groovy.template.configuration.base-template-class
    Specifies the template base class.

  • Spring.groovy.template.configuration.cache-templates
    If you want to cache the template, the default is True

  • Spring.groovy.template.configuration.declaration-encoding
    Encoding used when writing to the Declaration header

  • Spring.groovy.template.configuration.expand-empty-elements
    Whether to use <br/> this form, or <br></br> This expansion mode, the default is: false)

  • Spring.groovy.template.configuration.locale
    Specifies the template locale.

  • Spring.groovy.template.configuration.new-line-string
    When auto wrap is enabled, the output of newline is defaulted to the value of the system's Line.separator property

  • Spring.groovy.template.configuration.resource-loader-path
    Specifies the template path for groovy, which defaults to classpath:/templates/

  • Spring.groovy.template.configuration.use-double-quotes
    Specify whether to use double or single quotes for the property, false by default

  • Spring.groovy.template.content-type
    Specifies Content-type.

  • Spring.groovy.template.enabled
    Whether to turn on support for groovy templates.

  • Spring.groovy.template.expose-request-attributes
    Sets all request properties to be added to the model when the merge is in the template.

  • Spring.groovy.template.expose-session-attributes
    Sets all request properties to be added to the model when the merge is in the template.

  • Spring.groovy.template.expose-spring-macro-helpers
    Set whether to expose RequestContext to spring's macro library in the form of Springmacrorequestcontext

  • Spring.groovy.template.prefix
    Specifies the prefix for the template.

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

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

  • Spring.groovy.template.suffix
    Specify the suffix of the template

  • Spring.groovy.template.view-names
    Specifies the name of the view to use for the template.

http
    • Spring.hateoas.apply-to-primary-object-mapper
      Sets whether Hateoas is also supported for object Mapper, by default: True

    • Spring.http.converters.preferred-json-mapper
      Whether to convert using JSON mapper first.

    • Spring.http.encoding.charset
      Specify the HTTP request and the corresponding CharSet, default: UTF-8

    • Spring.http.encoding.enabled
      Whether to turn on encoding support for HTTP, which is true by default

    • Spring.http.encoding.force
      Whether to force HTTP requests and responses to be encoded, by default True

Json
  • Spring.jackson.date-format
    Specify the date format, such as Yyyy-mm-dd HH:mm:ss, or the fully qualified name of the specific formatting class

  • Spring.jackson.deserialization
    Whether to turn on the anti-serialization of Jackson

  • Spring.jackson.generator
    Whether to turn on JSON generators.

  • Spring.jackson.joda-date-time-format
    Specifies the format of the Joda date/time, such as Yyyy-mm-dd HH:mm:ss). If not configured, DateFormat will act as backup

  • Spring.jackson.locale
    Specifies the locale used by JSON.

  • Spring.jackson.mapper
    Whether to turn on Jackson Universal features.

  • Spring.jackson.parser
    Whether to turn on Jackson's parser feature.

  • Spring.jackson.property-naming-strategy
    Specifies Propertynamingstrategy (camel_case_to_lower_case_with_underscores) or the fully qualified class name of the Propertynamingstrategy subclass.

  • Spring.jackson.serialization
    Whether to turn on Jackson serialization.

  • Spring.jackson.serialization-inclusion
    Specifies the inclusion of the property at serialization time, viewing the Jsoninclude.include enumeration in detail.

  • Spring.jackson.time-zone
    Specify a date to format the 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 parameters that are passed to the jersey.

      • Spring.jersey.type
        Specifies the integration type of the jersey, which can be a servlet or filter.

Springboot Common Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.