|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
public abstract class WebMvcConfigurerAdapter
An abstract class with empty method implementations of WebMvcConfigurer.
Subclasses can override only the methods they need.
| Constructor Summary | |
|---|---|
WebMvcConfigurerAdapter()
|
|
| Method Summary | |
|---|---|
void |
addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
Add custom HandlerMethodArgumentResolvers to use in addition to the ones registered by default. |
void |
addFormatters(FormatterRegistry registry)
Add Converters and Formatters in addition to the ones registered by default. |
void |
addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Add custom HandlerMethodReturnValueHandlers to in addition to the ones registered by default. |
void |
configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)
Configure a handler for delegating unhandled requests by forwarding to the Servlet container's default servlet. |
void |
configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
Configure the list of HandlerExceptionResolvers to use for handling unresolved controller exceptions. |
void |
configureInterceptors(InterceptorConfigurer configurer)
Configure the Spring MVC interceptors to use. |
void |
configureMessageConverters(List<HttpMessageConverter<?>> converters)
Configure the list of HttpMessageConverters to use when resolving method arguments or handling
return values in @RequestMapping and @ExceptionHandler methods. |
void |
configureResourceHandling(ResourceConfigurer configurer)
Configure a handler for serving static resources such as images, js, and, css files through Spring MVC including setting cache headers optimized for efficient loading in a web browser. |
void |
configureViewControllers(ViewControllerConfigurer configurer)
Configure the view controllers to use. |
Validator |
getValidator()
Provide a custom Validator type replacing the one that would be created by default otherwise. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebMvcConfigurerAdapter()
| Method Detail |
|---|
public void addFormatters(FormatterRegistry registry)
Converters and Formatters in addition to the ones registered by default.
This implementation is empty.
addFormatters in interface WebMvcConfigurerpublic void configureMessageConverters(List<HttpMessageConverter<?>> converters)
HttpMessageConverters to use when resolving method arguments or handling
return values in @RequestMapping and @ExceptionHandler methods.
Specifying custom converters overrides the converters registered by default.
This implementation is empty.
configureMessageConverters in interface WebMvcConfigurerconverters - a list to add message converters topublic Validator getValidator()
Validator type replacing the one that would be created by default otherwise. If this
method returns null, and assuming a JSR-303 implementation is available on the classpath, a validator
of type LocalValidatorFactoryBean is created by default.
This implementation returns null
getValidator in interface WebMvcConfigurerpublic void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
HandlerMethodArgumentResolvers to use in addition to the ones registered by default.
Generally custom argument resolvers are invoked first. However this excludes default argument resolvers that
rely on the presence of annotations (e.g. @RequestParameter, @PathVariable, etc.). Those
argument resolvers are not customizable without configuring RequestMappingHandlerAdapter directly.
This implementation is empty.
addArgumentResolvers in interface WebMvcConfigurerargumentResolvers - the list of custom converters, initially emptypublic void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
HandlerMethodReturnValueHandlers to in addition to the ones registered by default.
Generally custom return value handlers are invoked first. However this excludes default return value handlers
that rely on the presence of annotations (e.g. @ResponseBody, @ModelAttribute, etc.). Those
handlers are not customizable without configuring RequestMappingHandlerAdapter directly.
This implementation is empty.
addReturnValueHandlers in interface WebMvcConfigurerreturnValueHandlers - the list of custom handlers, initially emptypublic void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
HandlerExceptionResolvers to use for handling unresolved controller exceptions.
Specifying exception resolvers overrides the ones registered by default.
This implementation is empty.
configureHandlerExceptionResolvers in interface WebMvcConfigurerexceptionResolvers - a list to add exception resolvers topublic void configureInterceptors(InterceptorConfigurer configurer)
HandlerInterceptor or
WebRequestInterceptor. They allow requests to be pre/post processed before/after controller
invocation. Interceptors can be registered to apply to all requests or limited to a set of path patterns.
This implementation is empty.
configureInterceptors in interface WebMvcConfigurerInterceptorConfigurerpublic void configureViewControllers(ViewControllerConfigurer configurer)
This implementation is empty.
configureViewControllers in interface WebMvcConfigurerpublic void configureResourceHandling(ResourceConfigurer configurer)
This implementation is empty.
configureResourceHandling in interface WebMvcConfigurerpublic void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)
DispatcherServlet is mapped to "/", which results in
cleaner URLs (without a servlet prefix) but may need to still allow some requests (e.g. static resources)
to be handled by the Servlet container's default servlet.
This implementation is empty.
configureDefaultServletHandling in interface WebMvcConfigurer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||