@Configuration @Import(value=ResultExceptionHandler.class) @EnableConfigurationProperties(value=org.springframework.boot.autoconfigure.web.ServerProperties.class) public class ResultErrorAutoConfig extends Object
实现对Filter异常进行统一处理
Constructor and Description |
---|
ResultErrorAutoConfig() |
Modifier and Type | Method and Description |
---|---|
org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler |
errorWebExceptionHandler(org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes,
org.springframework.boot.autoconfigure.web.ResourceProperties resourceProperties,
org.springframework.beans.factory.ObjectProvider<org.springframework.web.reactive.result.view.ViewResolver> viewResolvers,
org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer,
org.springframework.context.ApplicationContext applicationContext)
优先级高于 ErrorWebFluxAutoConfiguration.errorWebExceptionHandler(ErrorAttributes, ResourceProperties, ObjectProvider, ServerCodecConfigurer, ApplicationContext)
|
ResultResponseBodyHandler |
resultResponseBodyHandler(org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer,
org.springframework.web.reactive.accept.RequestedContentTypeResolver contentTypeResolver,
org.springframework.core.ReactiveAdapterRegistry reactiveAdapterRegistry)
默认优先级高于 ResponseBodyResultHandler
|
@Bean @Order(value=-2) public org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler errorWebExceptionHandler(org.springframework.boot.web.reactive.error.ErrorAttributes errorAttributes, org.springframework.boot.autoconfigure.web.ResourceProperties resourceProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.web.reactive.result.view.ViewResolver> viewResolvers, org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer, org.springframework.context.ApplicationContext applicationContext)
@Bean public ResultResponseBodyHandler resultResponseBodyHandler(org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer, @Qualifier(value="webFluxContentTypeResolver") org.springframework.web.reactive.accept.RequestedContentTypeResolver contentTypeResolver, @Qualifier(value="webFluxAdapterRegistry") org.springframework.core.ReactiveAdapterRegistry reactiveAdapterRegistry)
Copyright © 2022 Pivotal Software, Inc.. All rights reserved.