public interface WebFluxConfigurer
@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.
WebFluxConfigurationSupport
,
DelegatingWebFluxConfiguration
Modifier and Type | Method and Description |
---|---|
default void |
addCorsMappings(CorsRegistry registry)
Configure "global" cross origin request processing.
|
default void |
addFormatters(FormatterRegistry registry)
|
default void |
addResourceHandlers(ResourceHandlerRegistry registry)
Add resource handlers for serving static resources.
|
default void |
configureArgumentResolvers(ArgumentResolverConfigurer configurer)
Configure resolvers for custom
@RequestMapping method arguments. |
default void |
configureContentTypeResolver(RequestedContentTypeResolverBuilder builder)
Configure how the content type requested for the response is resolved
when handling reqests with annotated controllers.
|
default void |
configureHttpMessageCodecs(ServerCodecConfigurer configurer)
Configure custom HTTP message readers and writers or override built-in ones.
|
default void |
configurePathMatching(PathMatchConfigurer configurer)
Configure path matching options.
|
default void |
configureViewResolvers(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 (e.g.
|
default MessageCodesResolver |
getMessageCodesResolver()
Provide a custom
MessageCodesResolver to use for data binding in
annotated controller method arguments instead of the one created by
default in DataBinder . |
default Validator |
getValidator()
Provide a custom
Validator . |
default void configureContentTypeResolver(RequestedContentTypeResolverBuilder builder)
builder
- for configuring the resolvers to usedefault void addCorsMappings(CorsRegistry registry)
The configured readers and writers will apply to all requests including
annotated controllers and functional endpoints. Annotated controllers can
further declare more fine-grained configuration via
@CrossOrigin
.
CorsRegistry
default void configurePathMatching(PathMatchConfigurer configurer)
The configured path matching options will be used for mapping to
annotated controllers and also
static resources
.
configurer
- the PathMatchConfigurer
instancedefault void addResourceHandlers(ResourceHandlerRegistry registry)
ResourceHandlerRegistry
default void configureArgumentResolvers(ArgumentResolverConfigurer configurer)
@RequestMapping
method arguments.configurer
- to configurer to usedefault void configureHttpMessageCodecs(ServerCodecConfigurer configurer)
The configured readers and writers will be used for both annotated controllers and functional endpoints.
configurer
- the configurer to usedefault void addFormatters(FormatterRegistry registry)
@Nullable default Validator getValidator()
Validator
.
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.
@Nullable default MessageCodesResolver getMessageCodesResolver()
MessageCodesResolver
to use for data binding in
annotated controller method arguments instead of the one created by
default in DataBinder
.default void configureViewResolvers(ViewResolverRegistry registry)
The configured view resolvers will be used for both annotated controllers and functional endpoints.