SpringBoot四大神器之Starter

上、下拉电阻(定义、强弱上拉、常见作用、吸电流、拉电流、灌电流) 1.上、下拉电阻定义 上拉电阻是把一个信号通过一个电阻接到电源(Vcc),下拉电阻是一个信号通过一个电阻接到地(GND)。 2.强上拉、弱上拉 强上拉、弱上拉的强弱只是上拉电阻的阻值不同,没有什么严格区分。例如:50Ω上拉,一般成为强上拉;100kΩ上拉则称为弱上拉。下拉也是一样的。强拉电阻的极端就是0Ω电阻,即将信号线直接与电源或低相连接。 3.上、下拉电阻的作用 因为上下拉电阻的作用概念很宽泛,不用领域的使用方法也不同,常见使用方法整理如下: ... 阅读详情

序


序

主要是mvc相关的一些配置

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

mobile

  • spring.mobile.devicedelegatingviewresolver.enable-fallback是否支持fallback的解决方案,默认false

  • spring.mobile.devicedelegatingviewresolver.enabled是否开始device view resolver,默认为: false

  • spring.mobile.devicedelegatingviewresolver.mobile-prefix设定mobile端视图的前缀,默认为:mobile/

  • spring.mobile.devicedelegatingviewresolver.mobile-suffix设定mobile视图的后缀

  • spring.mobile.devicedelegatingviewresolver.normal-prefix设定普通设备的视图前缀

  • spring.mobile.devicedelegatingviewresolver.normal-suffix设定普通设备视图的后缀

  • spring.mobile.devicedelegatingviewresolver.tablet-prefix设定平板设备视图前缀,默认:tablet/

  • spring.mobile.devicedelegatingviewresolver.tablet-suffix设定平板设备视图后缀.

  • spring.mobile.sitepreference.enabled是否启用SitePreferenceHandler,默认为: true

view

  • spring.view.prefix设定mvc视图的前缀.

  • spring.view.suffix设定mvc视图的后缀.

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:/

multipart

  • multipart.enabled是否开启文件上传支持,默认为true

  • multipart.file-size-threshold设定文件写入磁盘的阈值,单位为MB或KB,默认为0

  • multipart.location指定文件上传路径.

  • multipart.max-file-size指定文件大小最大值,默认1MB

  • multipart.max-request-size指定每次请求的最大值,默认为10MB

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设定需要解析的视图名称.

thymeleaf

  • spring.thymeleaf.cache是否开启模板缓存,默认true

  • spring.thymeleaf.check-template-location是否检查模板路径是否存在,默认true

  • spring.thymeleaf.content-type指定Content-Type,默认为: text/html

  • spring.thymeleaf.enabled是否允许MVC使用Thymeleaf,默认为: true

  • spring.thymeleaf.encoding指定模板的编码,默认为: UTF-8

  • spring.thymeleaf.excluded-view-names指定不使用模板的视图名称,多个以逗号分隔.

  • spring.thymeleaf.mode指定模板的模式,具体查看StandardTemplateModeHandlers,默认为: HTML5

  • spring.thymeleaf.prefix指定模板的前缀,默认为:classpath:/templates/

  • spring.thymeleaf.suffix指定模板的后缀,默认为:.html

  • spring.thymeleaf.template-resolver-order指定模板的解析顺序,默认为第一个.

  • spring.thymeleaf.view-names指定使用模板的视图名,多个以逗号分隔.

mustcache

  • spring.mustache.cache是否Enable template caching.

  • spring.mustache.charset指定Template的编码.

  • spring.mustache.check-template-location是否检查默认的路径是否存在.

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

  • spring.mustache.enabled是否开启mustcache的模板支持.

  • spring.mustache.prefix指定模板的前缀,默认: classpath:/templates/

  • spring.mustache.suffix指定模板的后缀,默认: .html

  • spring.mustache.view-names指定要使用模板的视图名.

groovy模板

  • spring.groovy.template.allow-request-override指定HttpServletRequest的属性是否可以覆盖controller的model的同名项

  • spring.groovy.template.allow-session-override指定HttpSession的属性是否可以覆盖controller的model的同名项

  • spring.groovy.template.cache是否开启模板缓存.

  • spring.groovy.template.charset指定Template编码.

  • spring.groovy.template.check-template-location是否检查模板的路径是否存在.

  • spring.groovy.template.configuration.auto-escape是否在渲染模板时自动排查model的变量,默认为: false

  • spring.groovy.template.configuration.auto-indent是否在渲染模板时自动缩进,默认为false

  • spring.groovy.template.configuration.auto-indent-string如果自动缩进启用的话,是使用SPACES还是TAB,默认为: SPACES

  • spring.groovy.template.configuration.auto-new-line渲染模板时是否要输出换行,默认为false

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

  • spring.groovy.template.configuration.cache-templates是否要缓存模板,默认为true

  • spring.groovy.template.configuration.declaration-encoding在写入declaration header时使用的编码

  • spring.groovy.template.configuration.expand-empty-elements
    是使用<br/>这种形式,还是<br></br>这种展开模式,默认为: false)

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

  • spring.groovy.template.configuration.new-line-string当启用自动换行时,换行的输出,默认为系统的line.separator属性的值

  • spring.groovy.template.configuration.resource-loader-path指定groovy的模板路径,默认为classpath:/templates/

  • spring.groovy.template.configuration.use-double-quotes指定属性要使用双引号还是单引号,默认为false

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

  • spring.groovy.template.enabled是否开启groovy模板的支持.

  • spring.groovy.template.expose-request-attributes设定所有request的属性在merge到模板的时候,是否要都添加到model中.

  • spring.groovy.template.expose-session-attributes设定所有request的属性在merge到模板的时候,是否要都添加到model中.

  • spring.groovy.template.expose-spring-macro-helpers设定是否以springMacroRequestContext的形式暴露RequestContext给Spring’s macro library使用

  • spring.groovy.template.prefix指定模板的前缀.

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

  • spring.groovy.template.resource-loader-path指定模板的路径,默认为: classpath:/templates/

  • spring.groovy.template.suffix指定模板的后缀

  • spring.groovy.template.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.

jersey

  • spring.jersey.filter.order指定Jersey filter的order,默认为: 0

  • spring.jersey.init指定传递给Jersey的初始化参数.

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

SpringBoot的starter主要用来简化依赖用的。本文主要分两部分,一部分是列出一些starter的依赖,另一部分是教你自己写一个starter。


序

主要是mvc相关的一些配置

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

mobile

  • spring.mobile.devicedelegatingviewresolver.enable-fallback是否支持fallback的解决方案,默认false

  • spring.mobile.devicedelegatingviewresolver.enabled是否开始device view resolver,默认为: false

  • spring.mobile.devicedelegatingviewresolver.mobile-prefix设定mobile端视图的前缀,默认为:mobile/

  • spring.mobile.devicedelegatingviewresolver.mobile-suffix设定mobile视图的后缀

  • spring.mobile.devicedelegatingviewresolver.normal-prefix设定普通设备的视图前缀

  • spring.mobile.devicedelegatingviewresolver.normal-suffix设定普通设备视图的后缀

  • spring.mobile.devicedelegatingviewresolver.tablet-prefix设定平板设备视图前缀,默认:tablet/

  • spring.mobile.devicedelegatingviewresolver.tablet-suffix设定平板设备视图后缀.

  • spring.mobile.sitepreference.enabled是否启用SitePreferenceHandler,默认为: true

view

  • spring.view.prefix设定mvc视图的前缀.

  • spring.view.suffix设定mvc视图的后缀.

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:/

multipart

  • multipart.enabled是否开启文件上传支持,默认为true

  • multipart.file-size-threshold设定文件写入磁盘的阈值,单位为MB或KB,默认为0

  • multipart.location指定文件上传路径.

  • multipart.max-file-size指定文件大小最大值,默认1MB

  • multipart.max-request-size指定每次请求的最大值,默认为10MB

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设定需要解析的视图名称.

thymeleaf

  • spring.thymeleaf.cache是否开启模板缓存,默认true

  • spring.thymeleaf.check-template-location是否检查模板路径是否存在,默认true

  • spring.thymeleaf.content-type指定Content-Type,默认为: text/html

  • spring.thymeleaf.enabled是否允许MVC使用Thymeleaf,默认为: true

  • spring.thymeleaf.encoding指定模板的编码,默认为: UTF-8

  • spring.thymeleaf.excluded-view-names指定不使用模板的视图名称,多个以逗号分隔.

  • spring.thymeleaf.mode指定模板的模式,具体查看StandardTemplateModeHandlers,默认为: HTML5

  • spring.thymeleaf.prefix指定模板的前缀,默认为:classpath:/templates/

  • spring.thymeleaf.suffix指定模板的后缀,默认为:.html

  • spring.thymeleaf.template-resolver-order指定模板的解析顺序,默认为第一个.

  • spring.thymeleaf.view-names指定使用模板的视图名,多个以逗号分隔.

mustcache

  • spring.mustache.cache是否Enable template caching.

  • spring.mustache.charset指定Template的编码.

  • spring.mustache.check-template-location是否检查默认的路径是否存在.

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

  • spring.mustache.enabled是否开启mustcache的模板支持.

  • spring.mustache.prefix指定模板的前缀,默认: classpath:/templates/

  • spring.mustache.suffix指定模板的后缀,默认: .html

  • spring.mustache.view-names指定要使用模板的视图名.

groovy模板

  • spring.groovy.template.allow-request-override指定HttpServletRequest的属性是否可以覆盖controller的model的同名项

  • spring.groovy.template.allow-session-override指定HttpSession的属性是否可以覆盖controller的model的同名项

  • spring.groovy.template.cache是否开启模板缓存.

  • spring.groovy.template.charset指定Template编码.

  • spring.groovy.template.check-template-location是否检查模板的路径是否存在.

  • spring.groovy.template.configuration.auto-escape是否在渲染模板时自动排查model的变量,默认为: false

  • spring.groovy.template.configuration.auto-indent是否在渲染模板时自动缩进,默认为false

  • spring.groovy.template.configuration.auto-indent-string如果自动缩进启用的话,是使用SPACES还是TAB,默认为: SPACES

  • spring.groovy.template.configuration.auto-new-line渲染模板时是否要输出换行,默认为false

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

  • spring.groovy.template.configuration.cache-templates是否要缓存模板,默认为true

  • spring.groovy.template.configuration.declaration-encoding在写入declaration header时使用的编码

  • spring.groovy.template.configuration.expand-empty-elements
    是使用<br/>这种形式,还是<br></br>这种展开模式,默认为: false)

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

  • spring.groovy.template.configuration.new-line-string当启用自动换行时,换行的输出,默认为系统的line.separator属性的值

  • spring.groovy.template.configuration.resource-loader-path指定groovy的模板路径,默认为classpath:/templates/

  • spring.groovy.template.configuration.use-double-quotes指定属性要使用双引号还是单引号,默认为false

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

  • spring.groovy.template.enabled是否开启groovy模板的支持.

  • spring.groovy.template.expose-request-attributes设定所有request的属性在merge到模板的时候,是否要都添加到model中.

  • spring.groovy.template.expose-session-attributes设定所有request的属性在merge到模板的时候,是否要都添加到model中.

  • spring.groovy.template.expose-spring-macro-helpers设定是否以springMacroRequestContext的形式暴露RequestContext给Spring’s macro library使用

  • spring.groovy.template.prefix指定模板的前缀.

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

  • spring.groovy.template.resource-loader-path指定模板的路径,默认为: classpath:/templates/

  • spring.groovy.template.suffix指定模板的后缀

  • spring.groovy.template.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.

jersey

  • spring.jersey.filter.order指定Jersey filter的order,默认为: 0

  • spring.jersey.init指定传递给Jersey的初始化参数.

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

'PingFang SC', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', 'Microsoft Yahei', sans-serif;font-weight:500;line-height:1.2;color:rgb(51,51,51);font-size:1.75em;border-bottom:1px solid rgb(238,238,238);"> 部分starters的依赖
Starter(Group ID: org.springframework.boot) 传递依赖于
spring-boot-starter-log4j2 ■ org.apache.logging.log4j:log4j-slf4j-impl
■ org.apache.logging.log4j:log4j-api
■ org.apache.logging.log4j:log4j-core
■ org.slf4j:jcl-over-slf4j
■ org.slf4j:jul-to-slf4j
spring-boot-starter-logging ■ ch.qos.logback:logback-classic
■ org.slf4j:jcl-over-slf4j
■ org.slf4j:jul-to-slf4j
■ org.slf4j:log4j-over-slf4j
spring-boot-starter-mail ■ org.springframework.boot:spring-boot-starter
■ org.springframework:spring-context
■ org.springframework:spring-context-support
■ com.sun.mail:javax.mail
spring-boot-starter-mobile ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■ org.springframework.mobile:spring-mobile-device
spring-boot-starter-mustache ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■ com.samskivert:jmustache
spring-boot-starter-redis ■ org.springframework.boot:spring-boot-starter
■ org.springframework.data:spring-data-redis
■ redis.clients:jedis
spring-boot-starter-remote-shell ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-actuator
■ org.crashub:crash.cli
■ org.crashub:crash.connectors.ssh (excludes org.codehaus.groovy:groovy-all)
■ org.crashub:crash.connectors.telnet (excludes javax.servlet:servlet-api, log4j :log4j, commons-logging:commons-logging)
■ org.crashub:crash.embed.spring(excludes org.springframework:spring-web, org.codehaus.groovy:groovy-all)
■ org.crashub:crash.plugins.cron (excludes org.codehaus.groovy:groovy-all)
■ org.crashub:crash.plugins.mail (excludes org.codehaus.groovy:groovy-all)
■ org.crashub:crash.shell (excludes org.codehaus.groovy:groovy-all)
■ org.codehaus.groovy:groovy
spring-boot-starter-security ■ org.springframework.boot:spring-boot-starter
■ org.springframework:spring-aop
■org.springframework.security:spring-security-config
■org.springframework.security:spring-security-web
spring-boot-starter-social-facebook ■org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■org.springframework.social:spring-social-config
■ org.springframework.social:spring-social-core
■ org.springframework.social:spring-social-web
■org.springframework.social:spring-social-facebook
spring-boot-starter-social-linkedin ■org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■org.springframework.social:spring-social-config
■ org.springframework.social:spring-social-core
■ org.springframework.social:spring-social-web
■org.springframework.social:spring-social-linkedin
spring-boot-starter-social-twitter ■org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■ org.springframework.social:spring-social-config
■ org.springframework.social:spring-social-core
■org.springframework.social:spring-social-web
■ org.springframework.social:spring-social-twitter
spring-boot-starter-test ■ junit:junit
■ org.mockito:mockito-core
■ org.hamcrest:hamcrest-core
■ org.hamcrest:hamcrest-library
■ org.springframework:spring-core(excludes commons-logging:commons-logging)
■ org.springframework:spring-test
spring-boot-starter-thymeleaf ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■ org.thymeleaf:thymeleaf-spring4
■nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect
spring-boot-starter-tomcat ■ org.apache.tomcat.embed:tomcat-embed-core
■ org.apache.tomcat.embed:tomcat-embed-el
■org.apache.tomcat.embed:tomcat-embed-logging-juli
■org.apache.tomcat.embed:tomcat-embed-websocket
spring-boot-starter-undertow ■ io.undertow:undertow-core
■ io.undertow:undertow-servlet(excludes org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec)
■ io.undertow:undertow-websockets-jsr
■ javax.servlet:javax.servlet-api
■ org.glassfish:javax.el
spring-boot-starter-validation ■ org.springframework.boot:spring-boot-starter
■ org.apache.tomcat.embed:tomcat-embed-el
■org.hibernate:hibernate-validator
spring-boot-starter-velocity ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■ commons-beanutils:commons-beanutils
■ commons-collections:commons-collections
■ commons-digester:commons-digester
■ org.apache.velocity:velocity
■ org.apache.velocity:velocity-tools
■ org.springframework:spring-context-support
spring-boot-starter-web ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-tomcat
■ org.springframework.boot:spring-boot-starter-validation
■com.fasterxml.jackson.core:jackson-databind
■ org.springframework:spring-web
■ org.springframework:spring-webmvc
spring-boot-starter-websocket ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web
■ org.springframework:spring-messaging
■org.springframework:spring-websocket
spring-boot-starter-ws ■ org.springframework.boot:spring-boot-starter
■ org.springframework.boot:spring-boot-starter-web ■org.springframework:spring-jms
■ org.springframework:spring-oxm
■ org.springframework.ws:spring-ws-core
■ org.springframework.ws:spring-ws-support

Reference

来自<<Spring Boot in Action>>的附录B SpringBoot Starters的内容

如何自己写starter

主要步骤

  • 1、选择已有的starters,在此基础上进行扩展.

  • 2、创建自动配置文件并设定META-INF/spring.factories里的内容.

  • 3、发布你的starter

添加依赖管理


 
  1. <dependencyManagement>
  2. <dependencies>
  3. <dependency>
  4. <groupId>org.springframework.boot </groupId>
  5. <artifactId>spring-boot-dependencies </artifactId>
  6. <version>${spring.boot.version} </version>
  7. <type>pom </type>
  8. <scope>import </scope>
  9. </dependency>
  10. </dependencies>
  11. </dependencyManagement>

添加starter自己的依赖


 
  1. <dependencies>
  2. <dependency>
  3. <groupId>org.springframework.boot </groupId>
  4. <artifactId>spring-boot-starter </artifactId>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.springframework.boot </groupId>
  8. <artifactId>spring-boot-starter-web </artifactId>
  9. </dependency>
  10. </dependencies>

新建configuration


 
  1. @Configuration
  2. @ComponentScan( basePackages = { "com.patterncat.actuator"} )
  3. public class WebAutoConfiguration {
  4. /**
  5. * addViewController方法不支持placeholder的解析
  6. * 故在这里用变量解析出来
  7. */
  8. @Value( "${actuator.web.base:}")
  9. String actuatorBase;
  10. // @Bean
  11. // public ActuatorNavController actuatorNavController(){
  12. // return new ActuatorNavController();
  13. // }
  14. @Bean
  15. public WebMvcConfigurerAdapter configStaticMapping() {
  16. return new WebMvcConfigurerAdapter() {
  17. @Override
  18. public void addViewControllers(ViewControllerRegistry registry) {
  19. //配置跳转
  20. registry.addViewController(actuatorBase+ "/nav").setViewName(
  21. "forward:/static/nav.html");
  22. }
  23. @Override
  24. public void addResourceHandlers(ResourceHandlerRegistry registry) {
  25. registry.addResourceHandler( "/static/**").
  26. addResourceLocations( "classpath:/static/");
  27. }
  28. };
  29. }
  30. }

修改/META-INF/spring.factories


 
  1. # AutoConfigurations
  2. org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.patterncat.actuator.configuration.WebAutoConfiguration

发布

mvn clean install
 

引用


 
  1. <dependency>
  2. <groupId>com.patterncat </groupId>
  3. <artifactId>spring-boot-starter-actuator-web </artifactId>
  4. <version>1.0-SNAPSHOT </version>
  5. </dependency>

启动访问

mvn spring-boot:run
 

访问

http://localhost:8080/nav
 

note

告别地图偏移!手把手教你用MapOnline V1.2在ArcGIS里加载无偏谷歌影像和历史影像 本文详细介绍了如何使用MapOnline V1.2插件在ArcGIS中加载无偏谷歌影像和历史影像,解决GIS工程师长期面临的地图偏移问题。通过三步安装配置、无偏影像加载和时空分析功能,提升地理信息数据的精确度和工作效率,特别适用于城市规划、环境监测等场景。 阅读详情

相关推荐

CarMaker快速入门

本合集是小明师兄推出的CarMaker汽车仿真,CarMaker无论是传统动力学、动力系统开发、底盘系统开发还是目前智能驾驶辅助系统及智能驾驶系统开发有着非常重要的作用,可以有效节省开发周期和开发成本,基于仿真快速实现算法开发和系统验证。...

小明师兄的博客 1万+

Spring Boot 常用配置(properties、yml)

SPRING CONFIG (ConfigFileApplicationListener) spring.config.name 配置文件名称,默认为applicationspring.config.location 配置文件存放位置,默认为classpath目录下 若想知道SpringBoot为我们做了哪些自动配置,可以在application.properties里添加此参数 运行Spr...

ljk168的专栏 1169

用Origin快速拟合荧光寿命、PL Decay (TRPL)数据分析处理

用Origin快速拟合荧光寿命、PL Decay (TRPL)数据分析处理

A20802013的博客 2万+

SpringBoot常用配置

前言:springboot集成了主流的第三方框架,但是需要使用springboot那一套配置方式。但是我这里只列举了非常非常常用的,可以看已发的几篇博客,慢慢会补充。当然官方文档里也有相应的配置,可惜没有注释。 mvc spring.mvc.async.request-timeout 设定as...

chishaodou1255的博客 487

告别RXTX:SpringBoot集成jSerialComm实现更现代的串口通信(附完整代码对比)

本文详细介绍了如何从传统的RXTX库迁移到jSerialComm,实现SpringBoot项目中更现代的串口通信。通过对比两种技术的依赖配置、API设计和跨平台支持,展示了jSerialComm在简化部署、提升性能和增强稳定性方面的优势,并提供了完整的代码示例和实战经验。

weixin_42522964的博客 287

Wireshark时间分析实战:精准调试网络延迟与时间同步问题

本文深入探讨了Wireshark在网络延迟与时间同步问题分析中的核心应用。通过实战案例,详细讲解了如何设置时间显示格式、利用时间参考点量化关键路径延迟,以及运用时间平移功能校正错位时间轴。掌握这些时间分析技巧,能帮助网络工程师精准定位隐藏于数据包时序中的性能瓶颈与故障根源。

weixin_29290963的博客 262

Spring Boot、Spring MVC 和 Spring Cloud 深度解析

Spring Boot、Spring MVC 和 Spring Cloud是三个在Java企业级开发中非常重要的框架。他们各自具有不同的功能,但是也可以一起使用来创建强大且可扩展的应用程序。

沐雨风栉 3083

【异常】解决 Cursor 报错 Unexpected seqno: 2 != 1. Please try again, or contact support if the issue 的排坑指南

在使用 Cursor 辅助编程时,你是否遇到过 AI 突然中断输出,并在右下角弹出一个红色的 Network Error 弹窗?今天我们就来彻底解析并解决这个网络断连问题。

奶爸的编程之路,也就一周冷个三天 2480

spring-boot-starter-jersey的使用

jersey与resteasy一样都是JAX-RS即Java API for RESTful Web Services标准的实现,spring-boot-starter-jersey提供了对Jersey RESTful Web服务框架的支持,能够让我们轻松的构建RESTful Web工程。 新建工程 <groupId>com.wl.jersey</groupId> &...

wl的博客 5763

2026年中科曙光嵌入式软件岗位面试题库(附参考答案)

嵌入式系统与C/C++基础摘要 硬件与外设总线 SPI总线:高速全双工同步串行接口,采用SCLK、MOSI、MISO和CS信号线,支持一主多从架构,典型应用于Flash存储、传感器等高速外设。 I2C总线:两线制低速串行总线(SDA/SCL),支持多主多从,需注意地址冲突和信号完整性。 时序约束:包括建立时间、保持时间、时钟周期等,是保障电路稳定运行的关键。 AD转换:将模拟信号转换为数字信号,应用于传感器采集、音频处理等场景。 PC寄存器:存储下一条指令地址,控制程序执行流,在跳转和中断时自动更新。 C/

Open 70

GaussDB本地安装手册(主备模式)

如果实例状态是Normal,则安装成功。三节点集中式配置文件。

Sebastien23的博客 2635

Spring 中使用的设计模式 | Spring MVC 的执行流程 | Spring Boot Starter

通过引入 Starter,Spring Boot 自动为你配置相关组件和 Bean,无需手动设置和管理依赖项。在 Spring 框架中,有很多设计模式的应用,这些模式帮助 Spring 提供灵活、可扩展和解耦的架构。,Spring Boot 会自动配置相关的组件,例如嵌入式的 Tomcat 服务器、Spring MVC、Jackson 等,开发者无需手动进行配置。Spring Boot Starter 使得开发者只需引入相关的 Starter,即可快速集成相应的功能,而无需过多关注细节配置。

weixin_46053950的博客 688

万字数据仓库面试题及参考答案

星型模型由一个中心的事实表和多个外围的维度表组成,事实表存储度量值和事实,维度表存储描述性属性和维度。星型模型和雪花模型的区别在于雪花模型将维度表进一步细化,形成多层次的结构,而星型模型由一个中心事实表和多个维度表组成,适用于查询较为简单的情况。维度建模通常采用星型模型或雪花模型,将数据分为事实表和维度表,其中事实表存储度量值和事实,维度表存储描述事实的属性。三者之间的关系可以这样理解:数据仓库主要关注历史数据的存储和分析,数据中台则关注数据的服务化和资产化,而数据湖则关注原始数据的存储和多样性。

大模型大数据攻城狮的专栏 560

Spring Boot四大神器之Starter

1.概述 依赖管理是任何复杂项目的关键方面。手动完成这些操作并不理想; 你花在它上面的时间越多,你在项目的其他重要方面所花费的时间就越少。 构建Spring Boot启动器是为了解决这个问题。Starter POM是一组方便的依赖描述符,您可以在应用程序中包含这些描述符。您可以获得所需的所有Spring和相关技术的一站式服务,而无需搜索示例代码,并复制粘贴依赖描述符。 目前有超过30个启动启动器 ...

王浩的技术博客 4950

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

Spring Boot :四大神器之Starter

Spring Boot有四大神器,分别是auto-configuration、starters、cli、actuator。依赖管理是任何复杂项目的关键方面。手动完成这些操作并不理想;你花在它上面的时间越多,你在项目的其他重要方面所花费的时间就越少。构建Spring Boot启动器是为了解决这个问题。StarterPOM是一组方便的依赖描述符,您可以在应用程序中包含这些描述符。您可以获得所需的所有Spring和相关技术的一站式服务,而无需搜索示例代码,并复制粘贴依赖描述符。

Admans的专栏 1322

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

Spring Boot四大神器之创建自定义Starter

1. 概述 Spring Boot为开发人员提供了大多数流行的开源项目的启动器,但我们不仅限于此。 我们也可以编写自己的自定义启动器。 如果想为我们的组织提供一个内部库,并且将它在Spring Boot上下文中使用,那么为它编写一个启动器也许是一个好的习惯。 这些启动器使开发人员能够避免冗长的配置并快速启动他们的开发。但是,由于隐藏了在后台发生的很多事情,有时候很难理解注释或只是在pom.xml中...

王浩的技术博客 3007

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

springboot-Actuator(act)

为什么使用 查看若干springboot的有用的信息 引入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependenc...

wlwork66的博客 703

手把手教你开发SpringBoot starter

前言: SpringBoot在java中的地位简直是至尊的存在,非常的好用。Spring Boot有四大神器,分别是auto-configuration、starters、cli、actuator,我们用各种中间件的话就是各种starter 对应版本依赖引用,然后就是配置属性文件,就可以用了,其实工作当中,我们可以把一些通用的方法,服务来封装成starter,本文来交大家进行手动实现一个starter,满足我们以后工作的需要。 1.源码中的starter和自动配置: Spring boot开发的时候我们不需

u010720120的博客 683

SpringBoot配置属性之MQ

SpringBoot配置属性系列 SpringBoot配置属性之MVC SpringBoot配置属性之Server SpringBoot配置属性之DataSource SpringBoot配置属性之NOSQL SpringBoot配置属性之MQ SpringBoot配置属性之Security SpringBoot配置属性之Migrati...

weixin_33857679的博客 277
上一篇: 卸载node后重新安装vue-cli3.0失败,因为vue-cli没有卸载,
下一篇: IntelliJ IDEA 设置代码提示或自动补全的快捷键 (附IntelliJ IDEA常用快捷键)
Demo__
博客等级 码龄11年 83粉丝 3原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值