public class WebFluxConfigurationSupport extends Object implements ApplicationContextAware
Import directly or extend and override protected methods to customize.
Constructor and Description |
---|
WebFluxConfigurationSupport() |
public void setApplicationContext(@Nullable ApplicationContext applicationContext)
ApplicationContextAware
Invoked after population of normal bean properties but before an init callback such
as InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
,
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
and
MessageSourceAware
, if applicable.
setApplicationContext
in interface ApplicationContextAware
applicationContext
- the ApplicationContext object to be used by this objectBeanInitializationException
@Nullable public final ApplicationContext getApplicationContext()
@Bean public DispatcherHandler webHandler()
@Bean @Order(value=0) public WebExceptionHandler responseStatusExceptionHandler()
@Bean public RequestMappingHandlerMapping requestMappingHandlerMapping()
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping()
RequestMappingHandlerMapping
.@Bean public RequestedContentTypeResolver webFluxContentTypeResolver()
protected void configureContentTypeResolver(RequestedContentTypeResolverBuilder builder)
protected final Map<String,CorsConfiguration> getCorsConfigurations()
addCorsMappings(CorsRegistry)
to customize the CORS conifg.protected void addCorsMappings(CorsRegistry registry)
CorsRegistry
protected 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 ServerCodecConfigurer serverCodecConfigurer()
Use configureHttpMessageCodecs(ServerCodecConfigurer)
to
configure the readers and writers.
protected LocaleContextResolver createLocaleContextResolver()
LocaleContextResolver
.@Bean public LocaleContextResolver localeContextResolver()
protected void configureHttpMessageCodecs(ServerCodecConfigurer configurer)
protected ConfigurableWebBindingInitializer getConfigurableWebBindingInitializer()
ConfigurableWebBindingInitializer
to use for
initializing all WebDataBinder
instances.@Bean public FormattingConversionService webFluxConversionService()
protected void addFormatters(FormatterRegistry registry)
@Bean public ReactiveAdapterRegistry webFluxAdapterRegistry()
ReactiveAdapterRegistry
to adapting reactive types.@Bean public 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 Validator getValidator()
Validator
.@Nullable protected 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