@Configuration public class WebReactiveConfiguration extends Object implements org.springframework.context.ApplicationContextAware
Import directly or extend and override protected methods to customize.
Constructor and Description |
---|
WebReactiveConfiguration() |
Modifier and Type | Method and Description |
---|---|
protected void |
addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers)
Provide custom argument resolvers without overriding the built-in ones.
|
protected void |
addDefaultHttpMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> readers)
Adds default converters that sub-classes can call from
configureMessageReaders(List) . |
protected void |
addDefaultHttpMessageWriters(List<org.springframework.http.codec.HttpMessageWriter<?>> writers)
Adds default converters that sub-classes can call from
configureMessageWriters(List) . |
protected void |
addFormatters(org.springframework.format.FormatterRegistry registry)
Override to add custom
Converter s and Formatter s. |
protected void |
addResourceHandlers(ResourceHandlerRegistry registry)
Override this method to add resource handlers for serving static resources.
|
protected void |
configureMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders)
Override to configure the message readers to use for decoding
controller method arguments.
|
protected void |
configureMessageWriters(List<org.springframework.http.codec.HttpMessageWriter<?>> messageWriters)
Override to configure the message writers to use for encoding
return values.
|
void |
configurePathMatching(PathMatchConfigurer configurer)
Override to configure path matching options.
|
protected void |
configureRequestedContentTypeResolver(RequestedContentTypeResolverBuilder builder)
Override to configure how the requested content type is resolved.
|
protected void |
configureViewResolvers(ViewResolverRegistry registry)
Override this to configure view resolution.
|
protected RequestMappingHandlerAdapter |
createRequestMappingHandlerAdapter()
Override to plug a sub-class of
RequestMappingHandlerAdapter . |
protected RequestMappingHandlerMapping |
createRequestMappingHandlerMapping()
Override to plug a sub-class of
RequestMappingHandlerMapping . |
protected void |
extendMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders)
Override this to modify the list of message readers after it has been
configured, for example to add some in addition to the default ones.
|
protected void |
extendMessageWriters(List<org.springframework.http.codec.HttpMessageWriter<?>> messageWriters)
Override this to modify the list of message writers after it has been
configured, for example to add some in addition to the default ones.
|
protected org.springframework.context.ApplicationContext |
getApplicationContext() |
protected Map<String,org.springframework.http.MediaType> |
getDefaultMediaTypeMappings()
Override to configure media type mappings.
|
protected List<org.springframework.http.codec.HttpMessageReader<?>> |
getMessageReaders()
Main method to access message readers to use for decoding
controller method arguments with.
|
protected List<org.springframework.http.codec.HttpMessageWriter<?>> |
getMessageWriters()
Main method to access message writers to use for encoding return values.
|
protected PathMatchConfigurer |
getPathMatchConfigurer()
Callback for building the
PathMatchConfigurer . |
protected org.springframework.validation.Validator |
getValidator()
Override this method to provide a custom
Validator . |
CompositeContentTypeResolver |
mvcContentTypeResolver() |
org.springframework.format.support.FormattingConversionService |
mvcConversionService() |
org.springframework.validation.Validator |
mvcValidator()
Return a global
Validator instance for example for validating
@RequestBody method arguments. |
RequestMappingHandlerAdapter |
requestMappingHandlerAdapter() |
RequestMappingHandlerMapping |
requestMappingHandlerMapping() |
HandlerMapping |
resourceHandlerMapping()
Return a handler mapping ordered at Integer.MAX_VALUE-1 with mapped
resource handlers.
|
ResponseBodyResultHandler |
responseBodyResultHandler() |
ResponseEntityResultHandler |
responseEntityResultHandler() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
SimpleHandlerAdapter |
simpleHandlerAdapter() |
ViewResolutionResultHandler |
viewResolutionResultHandler() |
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
protected org.springframework.context.ApplicationContext getApplicationContext()
@Bean public RequestMappingHandlerMapping requestMappingHandlerMapping()
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping()
RequestMappingHandlerMapping
.@Bean public CompositeContentTypeResolver mvcContentTypeResolver()
protected Map<String,org.springframework.http.MediaType> getDefaultMediaTypeMappings()
protected void configureRequestedContentTypeResolver(RequestedContentTypeResolverBuilder builder)
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 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 addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers)
protected final List<org.springframework.http.codec.HttpMessageReader<?>> getMessageReaders()
Use configureMessageReaders(java.util.List<org.springframework.http.codec.HttpMessageReader<?>>)
to configure the list or
extendMessageReaders(java.util.List<org.springframework.http.codec.HttpMessageReader<?>>)
to add in addition to the default ones.
protected void configureMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders)
If no message readres are specified, default will be added via
addDefaultHttpMessageReaders(java.util.List<org.springframework.http.codec.HttpMessageReader<?>>)
.
messageReaders
- a list to add message readers to, initially an emptyprotected final void addDefaultHttpMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> readers)
configureMessageReaders(List)
.protected void extendMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders)
@Bean public org.springframework.format.support.FormattingConversionService mvcConversionService()
protected void addFormatters(org.springframework.format.FormatterRegistry registry)
Converter
s and Formatter
s.@Bean public org.springframework.validation.Validator mvcValidator()
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.
protected org.springframework.validation.Validator getValidator()
Validator
.@Bean public SimpleHandlerAdapter simpleHandlerAdapter()
@Bean public ResponseEntityResultHandler responseEntityResultHandler()
@Bean public ResponseBodyResultHandler responseBodyResultHandler()
protected final List<org.springframework.http.codec.HttpMessageWriter<?>> getMessageWriters()
Use configureMessageWriters(List)
to configure the list or
extendMessageWriters(List)
to add in addition to the default ones.
protected void configureMessageWriters(List<org.springframework.http.codec.HttpMessageWriter<?>> messageWriters)
If no message readers are specified, default will be added via
addDefaultHttpMessageWriters(java.util.List<org.springframework.http.codec.HttpMessageWriter<?>>)
.
messageWriters
- a list to add message writers to, initially an emptyprotected final void addDefaultHttpMessageWriters(List<org.springframework.http.codec.HttpMessageWriter<?>> writers)
configureMessageWriters(List)
.protected void extendMessageWriters(List<org.springframework.http.codec.HttpMessageWriter<?>> messageWriters)
@Bean public ViewResolutionResultHandler viewResolutionResultHandler()
protected void configureViewResolvers(ViewResolverRegistry registry)