Interface WebFluxConfigurer
- All Known Implementing Classes:
- WebFluxConfigurerComposite
@EnableWebFlux.
 @EnableWebFlux-annotated configuration classes may implement
 this interface to be called back and given a chance to customize the
 default configuration. Consider implementing this interface and
 overriding the relevant methods for your needs.
- Since:
- 5.0
- Author:
- Brian Clozel, Rossen Stoyanchev
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidaddCorsMappings(CorsRegistry registry) Configure "global" cross-origin request processing.default voidaddErrorResponseInterceptors(List<ErrorResponse.Interceptor> interceptors) Add to the list ofErrorResponse.Interceptor's to invoke when rendering an RFC 9457ProblemDetailerror response.default voidaddFormatters(FormatterRegistry registry) Add customConvertersandFormattersfor performing type conversion and formatting of annotated controller method arguments.default voidaddResourceHandlers(ResourceHandlerRegistry registry) Add resource handlers for serving static resources.default voidconfigureArgumentResolvers(ArgumentResolverConfigurer configurer) Configure resolvers for custom@RequestMappingmethod arguments.default voidConfigure settings related to blocking execution in WebFlux.default voidConfigure how the content type requested for the response is resolved when handling requests with annotated controllers.default voidconfigureHttpMessageCodecs(ServerCodecConfigurer configurer) Configure the HTTP message readers and writers for reading from the request body and for writing to the response body in annotated controllers and functional endpoints.default voidconfigurePathMatching(PathMatchConfigurer configurer) Configure path matching options.default voidconfigureViewResolvers(ViewResolverRegistry registry) Configure view resolution for rendering responses with a view and a model, where the view is typically an HTML template but could also be based on an HTTP message writer (for example, JSON, XML).default MessageCodesResolverProvide a customMessageCodesResolverto use for data binding in annotated controller method arguments instead of the one created by default inDataBinder.default ValidatorProvide a customValidator.default WebSocketServiceProvide theWebSocketServiceto createWebSocketHandlerAdapterwith.
- 
Method Details- 
configureHttpMessageCodecsConfigure the HTTP message readers and writers for reading from the request body and for writing to the response body in annotated controllers and functional endpoints.By default, all built-in readers and writers are configured as long as the corresponding 3rd party libraries such Jackson JSON, JAXB2, and others are present on the classpath. - Parameters:
- configurer- the configurer to customize readers and writers
 
- 
addFormattersAdd customConvertersandFormattersfor performing type conversion and formatting of annotated controller method arguments.
- 
getValidatorProvide a customValidator.By default a validator for standard bean validation is created if bean validation API is present on the classpath. The configured validator is used for validating annotated controller method arguments. 
- 
getMessageCodesResolverProvide a customMessageCodesResolverto use for data binding in annotated controller method arguments instead of the one created by default inDataBinder.
- 
addCorsMappingsConfigure "global" cross-origin request processing. The configured CORS mappings apply to annotated controllers, functional endpoints, and static resources.Annotated controllers can further declare more fine-grained config via @CrossOrigin. In such cases "global" CORS configuration declared here iscombinedwith local CORS configuration defined on a controller method.
- 
configureBlockingExecutionConfigure settings related to blocking execution in WebFlux.- Since:
- 6.1
 
- 
configureContentTypeResolverConfigure how the content type requested for the response is resolved when handling requests with annotated controllers.- Parameters:
- builder- for configuring the resolvers to use
 
- 
configurePathMatchingConfigure path matching options.The configured path matching options will be used for mapping to annotated controllers and also static resources.- Parameters:
- configurer- the- PathMatchConfigurerinstance
 
- 
configureArgumentResolversConfigure resolvers for custom@RequestMappingmethod arguments.- Parameters:
- configurer- to configurer to use
 
- 
addErrorResponseInterceptorsAdd to the list ofErrorResponse.Interceptor's to invoke when rendering an RFC 9457ProblemDetailerror response.- Parameters:
- interceptors- the handlers to use
- Since:
- 6.2
 
- 
configureViewResolversConfigure view resolution for rendering responses with a view and a model, where the view is typically an HTML template but could also be based on an HTTP message writer (for example, JSON, XML).The configured view resolvers will be used for both annotated controllers and functional endpoints. 
- 
addResourceHandlersAdd resource handlers for serving static resources.- See Also:
 
- 
getWebSocketServiceProvide theWebSocketServiceto createWebSocketHandlerAdapterwith. This can be used to configure server-specific properties through theRequestUpgradeStrategy.- Since:
- 5.3
 
 
-