open class WebMvcConfigurationSupport : ApplicationContextAware, ServletContextAware
This is the main class providing the configuration behind the MVC Java config. It is typically imported by adding EnableWebMvc to an application Configuration class. An alternative more advanced option is to extend directly from this class and override methods as necessary, remembering to add Configuration to the subclass and Bean to overridden Bean methods. For more details see the javadoc of EnableWebMvc.
This class registers the following HandlerMappings:
Integer.MAX_VALUE-1 to serve static resource requests. Integer.MAX_VALUE to forward requests to the default servlet. Registers these HandlerAdapters:
Registers a HandlerExceptionResolverComposite with this chain of exception resolvers:
Registers an AntPathMatcher and a UrlPathHelper to be used by:
Both the RequestMappingHandlerAdapter and the ExceptionHandlerExceptionResolver are configured with default instances of the following by default:
Author
Rossen Stoyanchev
Author
Brian Clozel
Author
Sebastien Deleuze
Since
3.1
See Also
EnableWebMvcWebMvcConfigurer
WebMvcConfigurationSupport()
This is the main class providing the configuration behind the MVC Java config. It is typically imported by adding EnableWebMvc to an application Configuration class. An alternative more advanced option is to extend directly from this class and override methods as necessary, remembering to add Configuration to the subclass and Bean to overridden Bean methods. For more details see the javadoc of EnableWebMvc. This class registers the following HandlerMappings:
Registers these HandlerAdapters:
Registers a HandlerExceptionResolverComposite with this chain of exception resolvers:
Registers an AntPathMatcher and a UrlPathHelper to be used by:
Both the RequestMappingHandlerAdapter and the ExceptionHandlerExceptionResolver are configured with default instances of the following by default:
|
open fun beanNameHandlerMapping(): BeanNameUrlHandlerMapping
Return a BeanNameUrlHandlerMapping ordered at 2 to map URL paths to controller bean names. |
|
open fun defaultServletHandlerMapping(): HandlerMapping
Return a handler mapping ordered at Integer.MAX_VALUE with a mapped default servlet handler. To configure "default" Servlet handling, override |
|
fun getApplicationContext(): ApplicationContext
Return the associated Spring ApplicationContext. |
|
fun getServletContext(): ServletContext
Return the associated javax.servlet.ServletContext. |
|
open fun handlerExceptionResolver(): HandlerExceptionResolver
Returns a HandlerExceptionResolverComposite containing a list of exception resolvers obtained either through Note: This method cannot be made final due to CGLib constraints. Rather than overriding it, consider overriding |
|
open fun httpRequestHandlerAdapter(): HttpRequestHandlerAdapter
Returns a HttpRequestHandlerAdapter for processing requests with HttpRequestHandlers. |
|
open fun mvcContentNegotiationManager(): ContentNegotiationManager
Return a ContentNegotiationManager instance to use to determine requested MediaType in a given request. |
|
open fun mvcConversionService(): FormattingConversionService
Return a FormattingConversionService for use with annotated controller methods and the |
|
open fun mvcHandlerMappingIntrospector(): HandlerMappingIntrospector |
|
open fun mvcPathMatcher(): PathMatcher
Return a global PathMatcher instance for path matching patterns in HandlerMappings. This instance can be configured using the PathMatchConfigurer in |
|
open fun mvcResourceUrlProvider(): ResourceUrlProvider
A ResourceUrlProvider bean for use with the MVC dispatcher. |
|
open fun mvcUriComponentsContributor(): CompositeUriComponentsContributor
Return an instance of CompositeUriComponentsContributor for use with org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder. |
|
open fun mvcUrlPathHelper(): UrlPathHelper
Return a global UrlPathHelper instance for path matching patterns in HandlerMappings. This instance can be configured using the PathMatchConfigurer in |
|
open fun mvcValidator(): Validator
Return a global Validator instance for example for validating |
|
open fun mvcViewResolver(): ViewResolver
Register a ViewResolverComposite that contains a chain of view resolvers to use for view resolution. By default this resolver is ordered at 0 unless content negotiation view resolution is used in which case the order is raised to If no other resolvers are configured, |
|
open fun requestMappingHandlerAdapter(): RequestMappingHandlerAdapter
Returns a RequestMappingHandlerAdapter for processing requests through annotated controller methods. Consider overriding one of these other more fine-grained methods:
|
|
open fun requestMappingHandlerMapping(): RequestMappingHandlerMapping
Return a RequestMappingHandlerMapping ordered at 0 for mapping requests to annotated controllers. |
|
open fun resourceHandlerMapping(): HandlerMapping
Return a handler mapping ordered at Integer.MAX_VALUE-1 with mapped resource handlers. To configure resource handling, override |
|
open fun setApplicationContext(applicationContext: ApplicationContext): Unit
Set the Spring ApplicationContext, e.g. for resource loading. |
|
open fun setServletContext(servletContext: ServletContext): Unit
Set the javax.servlet.ServletContext, e.g. for resource handling, looking up file extensions, etc. |
|
open fun simpleControllerHandlerAdapter(): SimpleControllerHandlerAdapter
Returns a SimpleControllerHandlerAdapter for processing requests with interface-based controllers. |
|
open fun viewControllerHandlerMapping(): HandlerMapping
Return a handler mapping ordered at 1 to map URL paths directly to view names. To configure view controllers, override |