public abstract class WebMvcConfigurerAdapter extends Object implements WebMvcConfigurer
WebMvcConfigurer with empty methods allowing
sub-classes to override only the methods they're interested in.| Constructor and Description |
|---|
WebMvcConfigurerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)
Add resolvers to support custom controller method argument types.
|
void |
addFormatters(org.springframework.format.FormatterRegistry registry)
Add <code>Converter</code>s and <code>Formatter</code>s in addition to the ones
registered by default.
|
void |
addInterceptors(InterceptorRegistry registry)
Add Spring MVC lifecycle interceptors for pre- and post-processing of
controller method invocations.
|
void |
addResourceHandlers(ResourceHandlerRegistry registry)
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<org.springframework.web.method.support.HandlerMethodReturnValueHandler> returnValueHandlers)
Add handlers to support custom controller method return value types.
|
void |
addViewControllers(ViewControllerRegistry registry)
Add view controllers to create a direct mapping between a URL path and
view name without the need for a controller in between.
|
void |
configureAsyncSupport(AsyncSupportConfigurer configurer)
Configure asynchronous request handling options.
|
void |
configureContentNegotiation(ContentNegotiationConfigurer configurer)
Configure content negotiation options.
|
void |
configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)
Configure a handler to delegate unhandled requests by forwarding to the
Servlet container's "default" servlet.
|
void |
configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
Configure the
HandlerExceptionResolvers to handle unresolved
controller exceptions. |
void |
configureMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Configure the <code>HttpMessageConverter</code>s to use in argument resolvers
and return value handlers that support reading and/or writing to the
body of the request and response.
|
org.springframework.validation.MessageCodesResolver |
getMessageCodesResolver()
Provide a custom <code>MessageCodesResolver</code> for building message codes
from data binding and validation error codes.
|
org.springframework.validation.Validator |
getValidator()
Provide a custom <code>Validator</code> instead of the one created by default.
|
public void addFormatters(org.springframework.format.FormatterRegistry registry)
This implementation is empty.
addFormatters in interface WebMvcConfigurerpublic void configureMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
This implementation is empty.
configureMessageConverters in interface WebMvcConfigurerconverters - initially an empty list of converterspublic org.springframework.validation.Validator getValidator()
null to keep the default.
This implementation returns null
getValidator 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 addArgumentResolvers(List<org.springframework.web.method.support.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<org.springframework.web.method.support.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 configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
HandlerExceptionResolvers to handle unresolved
controller exceptions. If no resolvers are added to the list, default
exception resolvers are added instead.
This implementation is empty.
configureHandlerExceptionResolvers in interface WebMvcConfigurerexceptionResolvers - initially an empty listpublic org.springframework.validation.MessageCodesResolver getMessageCodesResolver()
null to keep the default.
This implementation is empty.
getMessageCodesResolver in interface WebMvcConfigurerpublic void addInterceptors(InterceptorRegistry registry)
This implementation is empty.
addInterceptors in interface WebMvcConfigurerpublic void addViewControllers(ViewControllerRegistry registry)
This implementation is empty.
addViewControllers in interface WebMvcConfigurerpublic void addResourceHandlers(ResourceHandlerRegistry registry)
This implementation is empty.
addResourceHandlers 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 WebMvcConfigurer