程序包 org.springframework.web.servlet.config.annotation
Annotation-based setup for Spring MVC.
接口概要 接口 说明 WebMvcConfigurer Defines callback methods to customize the Java-based configuration for Spring MVC enabled via@EnableWebMvc
.类概要 类 说明 AsyncSupportConfigurer Helps with configuring options for asynchronous request processing.ContentNegotiationConfigurer Creates aContentNegotiationManager
and configures it with one or moreContentNegotiationStrategy
instances.CorsRegistration Assists with the creation of aCorsConfiguration
instance for a given URL path pattern.CorsRegistry Assists with the registration of global, URL pattern basedCorsConfiguration
mappings.DefaultServletHandlerConfigurer Configures a request handler for serving static resources by forwarding the request to the Servlet container's "default" Servlet.DelegatingWebMvcConfiguration A subclass ofWebMvcConfigurationSupport
that detects and delegates to all beans of typeWebMvcConfigurer
allowing them to customize the configuration provided byWebMvcConfigurationSupport
.InterceptorRegistration Assists with the creation of aMappedInterceptor
.InterceptorRegistry Helps with configuring a list of mapped interceptors.PathMatchConfigurer Helps with configuring HandlerMappings path matching options such as trailing slash match, suffix registration, path matcher and path helper.RedirectViewControllerRegistration Assist with the registration of a single redirect view controller.ResourceChainRegistration Assists with the registration of resource resolvers and transformers.ResourceHandlerRegistration Encapsulates information required to create a resource handler.ResourceHandlerRegistry Stores registrations of resource handlers for serving static resources such as images, css files and others through Spring MVC including setting cache headers optimized for efficient loading in a web browser.UrlBasedViewResolverRegistration Assist with configuring aUrlBasedViewResolver
.ViewControllerRegistration Assist with the registration of a single view controller.ViewControllerRegistry Assists with the registration of simple automated controllers pre-configured with status code and/or a view.ViewResolverRegistry Assist with the configuration of a chain ofViewResolver
instances.WebMvcConfigurationSupport This is the main class providing the configuration behind the MVC Java config.WebMvcConfigurerAdapter 已过时。 as of 5.0WebMvcConfigurer
has default methods (made possible by a Java 8 baseline) and can be implemented directly without the need for this adapter注释类型概要 注释类型 说明 EnableWebMvc Adding this annotation to an@Configuration
class imports the Spring MVC configuration fromWebMvcConfigurationSupport
, e.g.: