@Configuration @ConditionalOnClass(value=com.fasterxml.jackson.databind.ObjectMapper.class) @AutoConfigureBefore(value=org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration.class) public class JacksonConfiguration extends Object
| 构造器和说明 |
|---|
JacksonConfiguration() |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer |
customizer() |
void |
objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
org.springframework.web.context.request.RequestContextListener |
requestContextListener()
监听器: 监听HTTP请求事件
解决RequestContextHolder.getRequestAttributes()空指针问题
|
@Bean @ConditionalOnMissingBean public org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer customizer()
@Bean @ConditionalOnMissingBean(value=org.springframework.web.context.request.RequestContextListener.class) public org.springframework.web.context.request.RequestContextListener requestContextListener()
@Autowired public void objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Copyright © 2021 jvs. All rights reserved.