|
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.
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 toClass WebMvcConfigurationSupport, void addArgumentResolvers(List<HandlerMethodArgumentResolver>)ananapplication @Configuration class. An alternativemoremore advanced option is to extend directly from this class and override methods as necessary remembering to add @Configuration tothethe subclass and @Bean to overridden @Bean methods. For more details see the Javadoc of @EnableWebMvc.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
exceptionsexceptions through @ExceptionHandler methods.- ResponseStatusExceptionResolver for exceptions
annotatedannotated with @ResponseStatus.- DefaultHandlerExceptionResolver for resolving known
SpringSpring exception typesBoth the RequestMappingHandlerAdapter and
thethe ExceptionHandlerExceptionResolver are configured withdefaultdefault instances of the followingkind, unless custom instances arebyprovideddefault:
- A ContentNegotiationManager
- A DefaultFormattingConversionService
- A LocalValidatorFactoryBean if a JSR-303 implementation
isis available on the classpath- A range of HttpMessageConverters depending on the 3rd
partyparty libraries available on the classpath.@see EnableWebMvc @see WebMvcConfigurer @see WebMvcConfigurerAdapter @author Rossen Stoyanchev @since 3.1
Add custom HandlerMethodArgumentResolvers to use in additionClass WebMvcConfigurationSupport, void addDefaultHandlerExceptionResolvers(List<HandlerExceptionResolver>)toto the ones registered by default.Custom argument resolvers are invoked before built-in
resolversresolvers except for those that rely on the presence of annotations (e.g.{@code @RequestParameter}, {@code @PathVariable}, etc.).The latter can be customized by configuringthethe RequestMappingHandlerAdapter directly.@param argumentResolvers the list of custom converters;initially an empty list.
A method available to subclasses for adding defaultClass WebMvcConfigurationSupport, void addDefaultHttpMessageConverters(List<HttpMessageConverter<?>>)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
Adds a set of default HttpMessageConverter instances to the given list.Class WebMvcConfigurationSupport, void addInterceptors(InterceptorRegistry)Subclasses can call this method from .configureMessageConverters(List).@param messageConverters the list to add the default message converters to
Override this method to add Spring MVC interceptorsClass WebMvcConfigurationSupport, void addResourceHandlers(ResourceHandlerRegistry)forforpre- and post-processing of controller invocation. @see InterceptorRegistry
Override this method to add resource handlers for serving static resources.Class WebMvcConfigurationSupport, void addReturnValueHandlers(List<HandlerMethodReturnValueHandler>)@see ResourceHandlerRegistry
Add custom HandlerMethodReturnValueHandlers in addition toClass WebMvcConfigurationSupport, BeanNameUrlHandlerMapping beanNameHandlerMapping()thethe ones registered by default.Custom return value handlers are invoked before built-in ones
exceptexceptfor those that rely on the presence of annotations (e.g.{@code @ResponseBody}, {@code @ModelAttribute}, etc.).The latter can be customized by configuringthethe RequestMappingHandlerAdapter directly. @param returnValueHandlers the list of custom handlers;initially an empty list.
Return a BeanNameUrlHandlerMapping ordered at 2 to mapClass WebMvcConfigurationSupport, void configureDefaultServletHandling(DefaultServletHandlerConfigurer)URLURLpaths to controller bean names.
Override this method to configure "default" Servlet handling.Class WebMvcConfigurationSupport, void configureHandlerExceptionResolvers(List<HandlerExceptionResolver>)@see DefaultServletHandlerConfigurer
Override this method to configure the listClass WebMvcConfigurationSupport, void configureMessageConverters(List<HttpMessageConverter<?>>)ofofHandlerExceptionResolvers to use. Adding resolvers to thelistlist turns off the default resolvers that would otherwise be registeredbybydefault. Also see .addDefaultHandlerExceptionResolvers(List)that can be used to add the default exception resolvers. @param exceptionResolvers a list to add exception resolvers to;initially an empty list.
Override this method to add custom HttpMessageConverters toClass WebMvcConfigurationSupport, HandlerMapping defaultServletHandlerMapping()useusewith the RequestMappingHandlerAdapter andthethe ExceptionHandlerExceptionResolver. Adding converters tothethe list turns off the default converters that would otherwise be registered by default. Also see .addDefaultHttpMessageConverters(List)thatthat can be used to add default message converters. @param converters a list to add message converters to;initially an empty list.
Return a handler mapping ordered at Integer.MAX_VALUE with aClass WebMvcConfigurationSupport, Object[] getInterceptors()mappedmappeddefault servlet handler. To configure "default" Servlet handling,override .configureDefaultServletHandling.
Provide access to the shared handler interceptors used toClass WebMvcConfigurationSupport, List<HttpMessageConverter<?>> getMessageConverters()configureconfigureHandlerMapping instances with. This method cannot be overridden,use .addInterceptors(InterceptorRegistry) instead.
Provides access to the shared HttpMessageConverters used byClass WebMvcConfigurationSupport, HandlerExceptionResolver handlerExceptionResolver()thethe RequestMappingHandlerAdapter andthethe ExceptionHandlerExceptionResolver.This method cannot be overridden.Use .configureMessageConverters(List) instead. Also see .addDefaultHttpMessageConverters(List) that canbebe used to add default message converters.
Returns a HandlerExceptionResolverComposite containing a list of exception resolvers obtained eitherClass WebMvcConfigurationSupport, HttpRequestHandlerAdapter httpRequestHandlerAdapter()throughthrough .configureHandlerExceptionResolvers(List) or through .addDefaultHandlerExceptionResolvers(List).Note: This method cannot be made final due to CGLib constraints. Rather than overriding it, consider overriding .configureHandlerExceptionResolvers(List), which
allowsallows providing a list of resolvers.
Returns a HttpRequestHandlerAdapter for processingClass WebMvcConfigurationSupport, FormattingConversionService mvcConversionService()requestsrequestswith HttpRequestHandlers.
Returns a FormattingConversionService for use withClass WebMvcConfigurationSupport, Validator mvcValidator()annotatedannotatedcontroller methods and the {@code spring:eval} JSP tag.Also see .addFormatters as an alternative to overriding this method.
Returns a global Validator instance for example forClass WebMvcConfigurationSupport, RequestMappingHandlerAdapter requestMappingHandlerAdapter()validatingvalidating{@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-303303 implementation is not available, a no-op Validator is returned.
Returns a RequestMappingHandlerAdapter for processingClass WebMvcConfigurationSupport, RequestMappingHandlerMapping requestMappingHandlerMapping()requestsrequeststhrough annotated controller methods. Consider overriding one ofthesethese other more fine-grained methods:
- .addArgumentResolvers for adding custom argument resolvers.
- .addReturnValueHandlers for adding custom return value handlers.
- .configureMessageConverters for adding custom message converters.
Return a RequestMappingHandlerMapping ordered at 0 forClass WebMvcConfigurationSupport, HandlerMapping resourceHandlerMapping()mappingmappingrequests to annotated controllers.
Return a handler mapping ordered at Integer.MAX_VALUE-1 withClass WebMvcConfigurationSupport, SimpleControllerHandlerAdapter simpleControllerHandlerAdapter()mappedmappedresource handlers. To configure resource handling,overrideoverride .addResourceHandlers.
Returns a SimpleControllerHandlerAdapter for processingClass WebMvcConfigurationSupport, HandlerMapping viewControllerHandlerMapping()requestsrequestswith interface-based controllers.
Return a handler mapping ordered at 1 to map URL paths directlytoto view names. To configure view controllers,overrideoverride .addViewControllers.
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