public class WebFluxConfigurationSupport
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware
Import directly or extend and override protected methods to customize.
| Constructor and Description |
|---|
WebFluxConfigurationSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCorsMappings(CorsRegistry registry)
Override this method to configure cross origin requests processing.
|
protected void |
addFormatters(org.springframework.format.FormatterRegistry registry)
Override to add custom
Converters and Formatters. |
protected void |
addResourceHandlers(ResourceHandlerRegistry registry)
Override this method to add resource handlers for serving static resources.
|
protected void |
configureArgumentResolvers(ArgumentResolverConfigurer configurer)
Configure resolvers for custom controller method arguments.
|
protected void |
configureContentTypeResolver(RequestedContentTypeResolverBuilder builder)
Override to configure how the requested content type is resolved.
|
protected void |
configureHttpMessageCodecs(org.springframework.http.codec.ServerCodecConfigurer configurer)
Override to configure the HTTP message readers and writers to use.
|
void |
configurePathMatching(PathMatchConfigurer configurer)
Override to configure path matching options.
|
protected void |
configureViewResolvers(ViewResolverRegistry registry)
Configure view resolution for supporting template engines.
|
protected org.springframework.web.server.i18n.LocaleContextResolver |
createLocaleContextResolver()
Override to plug a sub-class of
LocaleContextResolver. |
protected RequestMappingHandlerAdapter |
createRequestMappingHandlerAdapter()
Override to plug a sub-class of
RequestMappingHandlerAdapter. |
protected RequestMappingHandlerMapping |
createRequestMappingHandlerMapping()
Override to plug a sub-class of
RequestMappingHandlerMapping. |
protected RouterFunctionMapping |
createRouterFunctionMapping()
Override to plug a sub-class of
RouterFunctionMapping. |
org.springframework.context.ApplicationContext |
getApplicationContext() |
protected org.springframework.web.bind.support.ConfigurableWebBindingInitializer |
getConfigurableWebBindingInitializer()
Return the
ConfigurableWebBindingInitializer to use for
initializing all WebDataBinder instances. |
protected java.util.Map<java.lang.String,org.springframework.web.cors.CorsConfiguration> |
getCorsConfigurations()
Callback for building the global CORS configuration.
|
protected org.springframework.validation.MessageCodesResolver |
getMessageCodesResolver()
Override this method to provide a custom
MessageCodesResolver. |
protected PathMatchConfigurer |
getPathMatchConfigurer()
Callback for building the
PathMatchConfigurer. |
protected org.springframework.validation.Validator |
getValidator()
Override this method to provide a custom
Validator. |
protected ViewResolverRegistry |
getViewResolverRegistry()
Callback for building the
ViewResolverRegistry. |
HandlerFunctionAdapter |
handlerFunctionAdapter() |
org.springframework.web.server.i18n.LocaleContextResolver |
localeContextResolver() |
RequestMappingHandlerAdapter |
requestMappingHandlerAdapter() |
RequestMappingHandlerMapping |
requestMappingHandlerMapping() |
HandlerMapping |
resourceHandlerMapping()
Return a handler mapping ordered at Integer.MAX_VALUE-1 with mapped
resource handlers.
|
ResponseBodyResultHandler |
responseBodyResultHandler() |
ResponseEntityResultHandler |
responseEntityResultHandler() |
org.springframework.web.server.WebExceptionHandler |
responseStatusExceptionHandler() |
RouterFunctionMapping |
routerFunctionMapping() |
org.springframework.http.codec.ServerCodecConfigurer |
serverCodecConfigurer()
Return the configurer for HTTP message readers and writers.
|
ServerResponseResultHandler |
serverResponseResultHandler() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
SimpleHandlerAdapter |
simpleHandlerAdapter() |
ViewResolutionResultHandler |
viewResolutionResultHandler() |
org.springframework.core.ReactiveAdapterRegistry |
webFluxAdapterRegistry()
Return a
ReactiveAdapterRegistry to adapting reactive types. |
RequestedContentTypeResolver |
webFluxContentTypeResolver() |
org.springframework.format.support.FormattingConversionService |
webFluxConversionService() |
org.springframework.validation.Validator |
webFluxValidator()
Return a global
Validator instance for example for validating
@RequestBody method arguments. |
DispatcherHandler |
webHandler() |
public void setApplicationContext(@Nullable
org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAware@Nullable public final org.springframework.context.ApplicationContext getApplicationContext()
@Bean public DispatcherHandler webHandler()
@Bean @Order(value=0) public org.springframework.web.server.WebExceptionHandler responseStatusExceptionHandler()
@Bean public RequestMappingHandlerMapping requestMappingHandlerMapping()
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping()
RequestMappingHandlerMapping.@Bean public RequestedContentTypeResolver webFluxContentTypeResolver()
protected void configureContentTypeResolver(RequestedContentTypeResolverBuilder builder)
protected final java.util.Map<java.lang.String,org.springframework.web.cors.CorsConfiguration> getCorsConfigurations()
addCorsMappings(CorsRegistry) to customize the CORS conifg.protected void addCorsMappings(CorsRegistry registry)
CorsRegistryprotected final PathMatchConfigurer getPathMatchConfigurer()
PathMatchConfigurer. This method is
final, use configurePathMatching(org.springframework.web.reactive.config.PathMatchConfigurer) to customize path matching.public void configurePathMatching(PathMatchConfigurer configurer)
@Bean public RouterFunctionMapping routerFunctionMapping()
protected RouterFunctionMapping createRouterFunctionMapping()
RouterFunctionMapping.@Bean public HandlerMapping resourceHandlerMapping()
addResourceHandlers(org.springframework.web.reactive.config.ResourceHandlerRegistry).protected void addResourceHandlers(ResourceHandlerRegistry registry)
ResourceHandlerRegistry@Bean public RequestMappingHandlerAdapter requestMappingHandlerAdapter()
protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter()
RequestMappingHandlerAdapter.protected void configureArgumentResolvers(ArgumentResolverConfigurer configurer)
@Bean public org.springframework.http.codec.ServerCodecConfigurer serverCodecConfigurer()
Use configureHttpMessageCodecs(ServerCodecConfigurer) to
configure the readers and writers.
protected org.springframework.web.server.i18n.LocaleContextResolver createLocaleContextResolver()
LocaleContextResolver.@Bean public org.springframework.web.server.i18n.LocaleContextResolver localeContextResolver()
protected void configureHttpMessageCodecs(org.springframework.http.codec.ServerCodecConfigurer configurer)
protected org.springframework.web.bind.support.ConfigurableWebBindingInitializer getConfigurableWebBindingInitializer()
ConfigurableWebBindingInitializer to use for
initializing all WebDataBinder instances.@Bean public org.springframework.format.support.FormattingConversionService webFluxConversionService()
protected void addFormatters(org.springframework.format.FormatterRegistry registry)
Converters and Formatters.@Bean public org.springframework.core.ReactiveAdapterRegistry webFluxAdapterRegistry()
ReactiveAdapterRegistry to adapting reactive types.@Bean public org.springframework.validation.Validator webFluxValidator()
Validator instance for example for validating
@RequestBody method arguments.
Delegates to getValidator() first. If that returns null
checks the classpath for the presence of a JSR-303 implementations
before creating a OptionalValidatorFactoryBean. If a JSR-303
implementation is not available, a "no-op" Validator is returned.
@Nullable protected org.springframework.validation.Validator getValidator()
Validator.@Nullable protected org.springframework.validation.MessageCodesResolver getMessageCodesResolver()
MessageCodesResolver.@Bean public HandlerFunctionAdapter handlerFunctionAdapter()
@Bean public SimpleHandlerAdapter simpleHandlerAdapter()
@Bean public ResponseEntityResultHandler responseEntityResultHandler()
@Bean public ResponseBodyResultHandler responseBodyResultHandler()
@Bean public ViewResolutionResultHandler viewResolutionResultHandler()
@Bean public ServerResponseResultHandler serverResponseResultHandler()
protected final ViewResolverRegistry getViewResolverRegistry()
ViewResolverRegistry. This method is final,
use configureViewResolvers(org.springframework.web.reactive.config.ViewResolverRegistry) to customize view resolvers.protected void configureViewResolvers(ViewResolverRegistry registry)
ViewResolverRegistry