@Configuration
public class WebConfig
extends java.lang.Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
| 限定符和类型 | 类和说明 |
|---|---|
static class |
WebConfig.BigDecimalStringSerilizer |
static class |
WebConfig.DateConvert |
static class |
WebConfig.RequestInterceptor |
| 构造器和说明 |
|---|
WebConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFormatters(org.springframework.format.FormatterRegistry registry) |
void |
addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry) |
void |
configurePathMatch(org.springframework.web.servlet.config.annotation.PathMatchConfigurer configurer) |
void |
extendMessageConverters(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
使用此方法 解决, 以下 spring-boot: jackson时间格式化 配置 失效 问题
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
原因: 会覆盖 @EnableAutoConfiguration 关于 WebMvcAutoConfiguration 的配置
|
com.github.wzc789376152.service.IResponseService |
getResponseService() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddArgumentResolvers, addCorsMappings, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configureViewResolvers, extendHandlerExceptionResolvers, getMessageCodesResolver, getValidatorpublic void extendMessageConverters(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
spring.jackson.time-zone=GMT+8 spring.jackson.date-format=yyyy-MM-dd HH:mm:ss 原因: 会覆盖 @EnableAutoConfiguration 关于 WebMvcAutoConfiguration 的配置
extendMessageConverters 在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurerpublic void configurePathMatch(org.springframework.web.servlet.config.annotation.PathMatchConfigurer configurer)
configurePathMatch 在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurerpublic void addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
addInterceptors 在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurerpublic void addFormatters(org.springframework.format.FormatterRegistry registry)
addFormatters 在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurer@Bean @ConditionalOnMissingBean public com.github.wzc789376152.service.IResponseService getResponseService()
Copyright © 2024. All Rights Reserved.