|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packageorg.springframework.web.servlet.config.annotation
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Configures a request handler for serving static resources by forwarding the request to the Servlet container's "default" Servlet. This isindendedintended to be used when the Spring MVC DispatcherServlet is mapped to "/" thus overriding the Servlet container's default handling of static resources. Since this handler is configured at the lowest precedence, effectively it allows all other handler mappings to handle the request, and if none of them do, this handler can forward it to the "default" Servlet. @author Rossen Stoyanchev @since 3.1 @see DefaultServletHttpRequestHandler
ExtendsA sub-class of {@code WebMvcConfigurationSupport}withthatthedetects andabilitydelegates todetectallbeansbeans of type WebMvcConfigurerand giveallowing thema chanceto customizethethe configuration providedconfigurationbydelegating{@codetoWebMvcConfigurationSupport}.them at the appropriateThis is the classtimes.actually importedby @EnableWebMvc. @author Rossen Stoyanchev @since 3.1 @see EnableWebMvc1
Class InterceptorRegistration, InterceptorRegistration addPathPatterns(String[])EncapsulatesAssistsa HandlerInterceptor and an optional list ofwithURL patterns. Results inthe creation of a MappedInterceptorif URL patterns are provided.@author Rossen Stoyanchev @author Keith Donald @since 3.1
Class InterceptorRegistration, Object getInterceptor()AddsAddone or moreURL patterns to which the registered interceptor should apply to.If no URL patterns are provided, the interceptor applies to all paths.
Returns the underlying interceptor. If URL patterns are provided the returned typeisisMappedInterceptor; otherwise HandlerInterceptor.
Class InterceptorRegistry, InterceptorRegistration addInterceptor(HandlerInterceptor)Stores and providesHelps with configuringaccess toa list ofinterceptors. For each interceptor you can optionallymappedspecify one or more URL patterns it applies tointerceptors. @author Rossen Stoyanchev @author KeithDonaldDonald @since 3.1
Adds the provided HandlerInterceptor.Class InterceptorRegistry, InterceptorRegistration addWebRequestInterceptor(WebRequestInterceptor)@param interceptor the interceptor to add @return An InterceptorRegistration that allows you optionally configurethethe registered interceptor further for example adding URL patterns it should apply to.
Adds the provided WebRequestInterceptor.@param interceptor the interceptor to add @return An InterceptorRegistration that allows you optionally configurethethe registered interceptor further for example adding URL patterns it should apply to.
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.Class WebMvcConfigurationSupport, void addDefaultHandlerExceptionResolvers(List<HandlerExceptionResolver>)This class registers the following HandlerMappings:
- RequestMappingHandlerMapping ordered at 0 for mapping requests to annotated controller methods.
- HandlerMapping ordered at 1 to map URL paths directly to view names.
- BeanNameUrlHandlerMapping ordered at 2 to map URL paths to controller bean names.
- HandlerMapping ordered at {@code Integer.MAX_VALUE-1} to serve static resource requests.
- HandlerMapping ordered at {@code Integer.MAX_VALUE} to forward requests to the default servlet.
Registers these HandlerAdapters:
- RequestMappingHandlerAdapter for processing requests with annotated controller methods.
- HttpRequestHandlerAdapter for processing requests with HttpRequestHandlers.
- SimpleControllerHandlerAdapter for processing requests with interface-based Controllers.
Registers a HandlerExceptionResolverComposite with this chain of exception resolvers:
- ExceptionHandlerExceptionResolver for handling exceptions through @ExceptionHandler methods.
- ResponseStatusExceptionResolver for exceptions annotated with @ResponseStatus.
- DefaultHandlerExceptionResolver for resolving known Spring exception types
Both the RequestMappingHandlerAdapter and the ExceptionHandlerExceptionResolver are configured with default instances of the following
kind, unless custom instances arebyprovideddefault:@see EnableWebMvc @see WebMvcConfigurer @see WebMvcConfigurerAdapter @author Rossen Stoyanchev @since 3.1
- A ContentNegotiationManager
- A DefaultFormattingConversionService
- A LocalValidatorFactoryBean if a JSR-303 implementation is available on the classpath
- A range of HttpMessageConverters depending on the 3rd party libraries available on the classpath.
A method available to subclasses for addingClass WebMvcConfigurationSupport, FormattingConversionService mvcConversionService()defaultdefault HandlerExceptionResolvers.Adds the following exception resolvers:
- ExceptionHandlerExceptionResolver for handling exceptions through @ExceptionHandler methods.
- ResponseStatusExceptionResolver for exceptions annotated with @ResponseStatus.
- DefaultHandlerExceptionResolver for resolving known Spring exception types
Class WebMvcConfigurationSupport, Validator mvcValidator()ReturnsReturn a FormattingConversionService for use with annotated controller methods and the {@code spring:eval} JSP tag. Also see .addFormatters as an alternative to overriding this method.
ReturnsReturn a global Validator instance for example for validating {@code @ModelAttribute} and {@code @RequestBody} method arguments. Delegates to .getValidator() first and if that returns {@code null} checks the classpath for the presence of a JSR-303 implementations before creating a {@code LocalValidatorFactoryBean}.If a JSR-303 implementation is not available, a no-op Validator is returned.
Defines callback methods to customize the Java-based configurationClass WebMvcConfigurer, void addArgumentResolvers(List<HandlerMethodArgumentResolver>)forforSpring MVC enabled via {@code @EnableWebMvc}.{@code @EnableWebMvc}-annotated configuration classes may
implementimplement this interface to be called back and given a chance to customize the default configuration. Consider extending WebMvcConfigurerAdapter, which provides a stub implementation of all interface methods. @author Rossen Stoyanchev @author Keith Donald @author David Syer @since 3.1
Add resolvers to support custom controller method argument types.Class WebMvcConfigurer, void addFormatters(FormatterRegistry)This does not override the built-in support for resolving
handlerhandler method arguments. To customize the built-in support forargumentargument resolution, configure RequestMappingHandlerAdapter directly. @param argumentResolvers initially an empty list
Add Converters and Formatters in addition to theClass WebMvcConfigurer, void addInterceptors(InterceptorRegistry)onesonesregistered by default.
Add Spring MVC lifecycle interceptors for pre- and post-processingClass WebMvcConfigurer, void addResourceHandlers(ResourceHandlerRegistry)ofof controller method invocations. Interceptors can be registered toapplyapply to all requests or be limited to a subset of URL patterns.
Add handlers to serve static resources such as images, js, and,Class WebMvcConfigurer, void addReturnValueHandlers(List<HandlerMethodReturnValueHandler>)csscssfiles from specific locations under web application root, the classpath, and others.
Add handlers to support custom controller method return value types.Class WebMvcConfigurer, void addViewControllers(ViewControllerRegistry)Using this option does not override the built-in support for handling return values. To customize the built-in support for handling
returnreturn values, configure RequestMappingHandlerAdapter directly. @param returnValueHandlers initially an empty list
Add view controllers to create a direct mapping between a URL pathClass WebMvcConfigurer, void configureDefaultServletHandling(DefaultServletHandlerConfigurer)andandview name without the need for a controller in between.
Configure a handler to delegate unhandled requests by forwarding toClass WebMvcConfigurer, void configureHandlerExceptionResolvers(List<HandlerExceptionResolver>)thethe Servlet container's "default" servlet. A common use case for this is when the DispatcherServlet is mapped to "/" thus overridingthethe Servlet container's default handling of static resources.
Configure the HandlerExceptionResolvers to handleunresolvedunresolvedcontroller exceptions. If no resolvers are added to the list, default exception resolvers are added instead. @param exceptionResolvers initially an empty list
Anconvenient baseimplementation ofclassWebMvcConfigurer with emptymethod implementationsmethods allowingofsub-classesWebMvcConfigurerto override only the methods they're interested in. @author Rossen Stoyanchev @since 3.1