类 WebMvcConfigurationSupport

java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.config.WebMvcConfigurationSupport
所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.context.ApplicationContextAware
直接已知子类:
DelegatingWebMvcConfiguration

public class WebMvcConfigurationSupport extends cn.taketoday.context.support.ApplicationObjectSupport
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:

HttpRequestHandler is default handler to handle HTTP request

Registers a CompositeHandlerExceptionHandler with this chain of exception handlers:

Note that those beans can be configured with a PathMatchConfigurer.

Both the RequestMappingHandlerAdapter and the ExceptionHandlerAnnotationExceptionHandler 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.
从以下版本开始:
4.0 2022/1/27 23:43
作者:
Rossen Stoyanchev, Brian Clozel, Sebastien Deleuze, Harry Yang
另请参阅: