public class WebFluxConfigurationSupport extends Object implements ApplicationContextAware
Import directly or extend and override protected methods to customize.
Constructor and Description |
---|
WebFluxConfigurationSupport() |
@Nullable public final ApplicationContext getApplicationContext()
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
@Bean public DispatcherHandler webHandler()
@Bean @Order(value=0) public WebExceptionHandler responseStatusExceptionHandler()
@Bean public RequestMappingHandlerMapping requestMappingHandlerMapping(@Qualifier(value="webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver)
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(ServerCodecConfigurer serverCodecConfigurer)
protected RouterFunctionMapping createRouterFunctionMapping()
RouterFunctionMapping
.@Bean public HandlerMapping resourceHandlerMapping(ResourceUrlProvider resourceUrlProvider)
addResourceHandlers(org.springframework.web.reactive.config.ResourceHandlerRegistry)
.@Bean public ResourceUrlProvider resourceUrlProvider()
protected void addResourceHandlers(ResourceHandlerRegistry registry)
ResourceHandlerRegistry
@Bean public RequestMappingHandlerAdapter requestMappingHandlerAdapter(@Qualifier(value="webFluxAdapterRegistry") ReactiveAdapterRegistry reactiveAdapterRegistry, ServerCodecConfigurer serverCodecConfigurer, @Qualifier(value="webFluxConversionService") FormattingConversionService conversionService, @Qualifier(value="webFluxValidator") Validator validator)
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(FormattingConversionService webFluxConversionService, Validator webFluxValidator)
ConfigurableWebBindingInitializer
to use for
initializing all WebDataBinder
instances.@Bean public FormattingConversionService webFluxConversionService()
FormattingConversionService
for use with annotated controllers.
See addFormatters(org.springframework.format.FormatterRegistry)
as an alternative to overriding this method.
protected void addFormatters(FormatterRegistry registry)
Converter
and/or Formatter
delegates to the common FormattingConversionService
.webFluxConversionService()
@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(@Qualifier(value="webFluxAdapterRegistry") ReactiveAdapterRegistry reactiveAdapterRegistry, ServerCodecConfigurer serverCodecConfigurer, @Qualifier(value="webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver)
@Bean public ResponseBodyResultHandler responseBodyResultHandler(@Qualifier(value="webFluxAdapterRegistry") ReactiveAdapterRegistry reactiveAdapterRegistry, ServerCodecConfigurer serverCodecConfigurer, @Qualifier(value="webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver)
@Bean public ViewResolutionResultHandler viewResolutionResultHandler(@Qualifier(value="webFluxAdapterRegistry") ReactiveAdapterRegistry reactiveAdapterRegistry, @Qualifier(value="webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver)
@Bean public ServerResponseResultHandler serverResponseResultHandler(ServerCodecConfigurer serverCodecConfigurer)
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