WebMvcConfigurer has default methods (made
possible by a Java 8 baseline) and can be implemented directly without the
need for this adapter@Deprecated public abstract class WebMvcConfigurerAdapter extends Object implements WebMvcConfigurer
WebMvcConfigurer with empty methods allowing
subclasses to override only the methods they're interested in.| Constructor and Description |
|---|
WebMvcConfigurerAdapter()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
Deprecated.
Add resolvers to support custom controller method argument types.
|
void |
addCorsMappings(CorsRegistry registry)
Deprecated.
Configure cross origin requests processing.
|
void |
addFormatters(FormatterRegistry registry)
Deprecated.
Add
Converters and Formatters in addition to the ones
registered by default. |
void |
addInterceptors(InterceptorRegistry registry)
Deprecated.
Add Spring MVC lifecycle interceptors for pre- and post-processing of
controller method invocations.
|
void |
addResourceHandlers(ResourceHandlerRegistry registry)
Deprecated.
Add handlers to serve static resources such as images, js, and, css
files from specific locations under web application root, the classpath,
and others.
|
void |
addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Deprecated.
Add handlers to support custom controller method return value types.
|
void |
addViewControllers(ViewControllerRegistry registry)
Deprecated.
Configure simple automated controllers pre-configured with the response
status code and/or a view to render the response body.
|
void |
configureAsyncSupport(AsyncSupportConfigurer configurer)
Deprecated.
Configure asynchronous request handling options.
|
void |
configureContentNegotiation(ContentNegotiationConfigurer configurer)
Deprecated.
Configure content negotiation options.
|
void |
configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)
Deprecated.
Configure a handler to delegate unhandled requests by forwarding to the
Servlet container's "default" servlet.
|
void |
configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
Deprecated.
Configure exception resolvers.
|
void |
configureMessageConverters(List<HttpMessageConverter<?>> converters)
Deprecated.
Configure the
HttpMessageConverters to use for reading or writing
to the body of the request or response. |
void |
configurePathMatch(PathMatchConfigurer configurer)
Deprecated.
Helps with configuring HandlerMappings path matching options such as trailing slash match,
suffix registration, path matcher and path helper.
|
void |
configureViewResolvers(ViewResolverRegistry registry)
Deprecated.
Configure view resolvers to translate String-based view names returned from
controllers into concrete
View
implementations to perform rendering with. |
void |
extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
Deprecated.
Extending or modify the list of exception resolvers configured by default.
|
void |
extendMessageConverters(List<HttpMessageConverter<?>> converters)
Deprecated.
A hook for extending or modifying the list of converters after it has been
configured.
|
MessageCodesResolver |
getMessageCodesResolver()
Deprecated.
Provide a custom
MessageCodesResolver for building message codes
from data binding and validation error codes. |
Validator |
getValidator()
Deprecated.
Provide a custom
Validator instead of the one created by default. |
public void configurePathMatch(PathMatchConfigurer configurer)
This implementation is empty.
configurePathMatch in interface WebMvcConfigurerpublic void configureContentNegotiation(ContentNegotiationConfigurer configurer)
This implementation is empty.
configureContentNegotiation in interface WebMvcConfigurerpublic void configureAsyncSupport(AsyncSupportConfigurer configurer)
This implementation is empty.
configureAsyncSupport in interface WebMvcConfigurerpublic void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)
DispatcherServlet is mapped to "/" thus overriding the
Servlet container's default handling of static resources.
This implementation is empty.
configureDefaultServletHandling in interface WebMvcConfigurerpublic void addFormatters(FormatterRegistry registry)
Converters and Formatters in addition to the ones
registered by default.
This implementation is empty.
addFormatters in interface WebMvcConfigurerpublic void addInterceptors(InterceptorRegistry registry)
Note that interceptors registered here only apply to
controllers and not to resource handler requests. To intercept requests for
static resources either declare a
MappedInterceptor
bean or switch to advanced configuration mode by extending
WebMvcConfigurationSupport and then override resourceHandlerMapping.
This implementation is empty.
addInterceptors in interface WebMvcConfigurerpublic void addResourceHandlers(ResourceHandlerRegistry registry)
This implementation is empty.
addResourceHandlers in interface WebMvcConfigurerpublic void addCorsMappings(CorsRegistry registry)
This implementation is empty.
addCorsMappings in interface WebMvcConfigurerpublic void addViewControllers(ViewControllerRegistry registry)
This implementation is empty.
addViewControllers in interface WebMvcConfigurerpublic void configureViewResolvers(ViewResolverRegistry registry)
View
implementations to perform rendering with.
This implementation is empty.
configureViewResolvers in interface WebMvcConfigurerpublic void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
This does not override the built-in support for resolving handler
method arguments. To customize the built-in support for argument
resolution, configure RequestMappingHandlerAdapter directly.
This implementation is empty.
addArgumentResolvers in interface WebMvcConfigurerargumentResolvers - initially an empty listpublic void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Using this option does not override the built-in support for handling return values. To customize the built-in support for handling return values, configure RequestMappingHandlerAdapter directly.
This implementation is empty.
addReturnValueHandlers in interface WebMvcConfigurerreturnValueHandlers - initially an empty listpublic void configureMessageConverters(List<HttpMessageConverter<?>> converters)
HttpMessageConverters to use for reading or writing
to the body of the request or response. If no converters are added, a
default list of converters is registered.
Note that adding converters to the list, turns off
default converter registration. To simply add a converter without impacting
default registration, consider using the method
WebMvcConfigurer.extendMessageConverters(java.util.List) instead.
This implementation is empty.
configureMessageConverters in interface WebMvcConfigurerconverters - initially an empty list of converterspublic void extendMessageConverters(List<HttpMessageConverter<?>> converters)
This implementation is empty.
extendMessageConverters in interface WebMvcConfigurerconverters - the list of configured converters to extend.public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
The given list starts out empty. If it is left empty, the framework
configures a default set of resolvers, see
WebMvcConfigurationSupport.addDefaultHandlerExceptionResolvers(List).
Or if any exception resolvers are added to the list, then the application
effectively takes over and must provide, fully initialized, exception
resolvers.
Alternatively you can use
WebMvcConfigurer.extendHandlerExceptionResolvers(List) which allows you to extend
or modify the list of exception resolvers configured by default.
This implementation is empty.
configureHandlerExceptionResolvers in interface WebMvcConfigurerexceptionResolvers - initially an empty listWebMvcConfigurer.extendHandlerExceptionResolvers(List),
WebMvcConfigurationSupport.addDefaultHandlerExceptionResolvers(List)public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
This implementation is empty.
extendHandlerExceptionResolvers in interface WebMvcConfigurerexceptionResolvers - the list of configured resolvers to extendWebMvcConfigurationSupport.addDefaultHandlerExceptionResolvers(List)@Nullable public Validator getValidator()
Validator instead of the one created by default.
The default implementation, assuming JSR-303 is on the classpath, is:
OptionalValidatorFactoryBean.
Leave the return value as null to keep the default.
This implementation returns null.
getValidator in interface WebMvcConfigurer@Nullable public MessageCodesResolver getMessageCodesResolver()
MessageCodesResolver for building message codes
from data binding and validation error codes. Leave the return value as
null to keep the default.
This implementation returns null.
getMessageCodesResolver in interface WebMvcConfigurer