Class WebMvcConfigurationSupport

java.lang.Object
org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware
Direct Known Subclasses:
DelegatingWebMvcConfiguration

public class WebMvcConfigurationSupport extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.web.context.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:

Registers these HandlerAdapters:

Registers a HandlerExceptionResolverComposite with this chain of exception resolvers:

Registers an AntPathMatcher and a UrlPathHelper to be used by:

Note that those beans can be configured with a PathMatchConfigurer.

Both the RequestMappingHandlerAdapter and the ExceptionHandlerExceptionResolver are configured with default instances of the following by default:

  • a ContentNegotiationManager
  • a DefaultFormattingConversionService
  • an OptionalValidatorFactoryBean if a JSR-303 implementation is available on the classpath
  • a range of HttpMessageConverters depending on the third-party libraries available on the classpath.
Since:
3.1
Author:
Rossen Stoyanchev, Brian Clozel, Sebastien Deleuze
See Also: