diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java index 65c5daf5f2..d2cf79fb86 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java @@ -107,7 +107,7 @@ import org.springframework.web.util.UrlPathHelper; * subclass and {@link Bean @Bean} to overridden {@link Bean @Bean} methods. * For more details see the javadoc of {@link EnableWebMvc @EnableWebMvc}. * - *
This class registers the following {@link HandlerMapping}s:
+ *This class registers the following {@link HandlerMapping HandlerMappings}:
*Registers these {@link HandlerAdapter}s: + *
Registers these {@link HandlerAdapter HandlerAdapters}: *
Registers a {@link HandlerExceptionResolverComposite} with this chain of @@ -159,7 +159,7 @@ import org.springframework.web.util.UrlPathHelper; *
This method cannot be overridden; use {@link #addInterceptors} instead. */ protected final Object[] getInterceptors() { if (this.interceptors == null) { @@ -358,15 +358,15 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv /** * Override this method to configure path matching options. - * @see PathMatchConfigurer * @since 4.0.3 + * @see PathMatchConfigurer */ protected void configurePathMatch(PathMatchConfigurer configurer) { } /** * Return a global {@link PathMatcher} instance for path matching - * patterns in {@link HandlerMapping}s. + * patterns in {@link HandlerMapping HandlerMappings}. * This instance can be configured using the {@link PathMatchConfigurer} * in {@link #configurePathMatch(PathMatchConfigurer)}. * @since 4.1 @@ -379,7 +379,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv /** * Return a global {@link UrlPathHelper} instance for path matching - * patterns in {@link HandlerMapping}s. + * patterns in {@link HandlerMapping HandlerMappings}. * This instance can be configured using the {@link PathMatchConfigurer} * in {@link #configurePathMatch(PathMatchConfigurer)}. * @since 4.1 @@ -682,9 +682,8 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv /** * Provide access to the shared custom argument resolvers used by the - * {@link RequestMappingHandlerAdapter} and the - * {@link ExceptionHandlerExceptionResolver}. This method cannot be - * overridden, use {@link #addArgumentResolvers(List)} instead. + * {@link RequestMappingHandlerAdapter} and the {@link ExceptionHandlerExceptionResolver}. + *
This method cannot be overridden; use {@link #addArgumentResolvers} instead.
* @since 4.3
*/
protected final List Custom argument resolvers are invoked before built-in resolvers
- * except for those that rely on the presence of annotations (e.g.
- * {@code @RequestParameter}, {@code @PathVariable}, etc.).
- * The latter can be customized by configuring the
+ * Add custom {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
+ * to use in addition to the ones registered by default.
+ * Custom argument resolvers are invoked before built-in resolvers except for
+ * those that rely on the presence of annotations (e.g. {@code @RequestParameter},
+ * {@code @PathVariable}, etc). The latter can be customized by configuring the
* {@link RequestMappingHandlerAdapter} directly.
- * @param argumentResolvers the list of custom converters;
- * initially an empty list.
+ * @param argumentResolvers the list of custom converters (initially an empty list)
*/
protected void addArgumentResolvers(List This method cannot be overridden; use {@link #addReturnValueHandlers} instead.
* @since 4.3
*/
protected final List Custom return value handlers are invoked before built-in ones except
- * for those that rely on the presence of annotations (e.g.
- * {@code @ResponseBody}, {@code @ModelAttribute}, etc.).
- * The latter can be customized by configuring the
+ * Add custom {@link HandlerMethodReturnValueHandler HandlerMethodReturnValueHandlers}
+ * in addition to the ones registered by default.
+ * Custom return value handlers are invoked before built-in ones except for
+ * those that rely on the presence of annotations (e.g. {@code @ResponseBody},
+ * {@code @ModelAttribute}, etc). The latter can be customized by configuring the
* {@link RequestMappingHandlerAdapter} directly.
- * @param returnValueHandlers the list of custom handlers;
- * initially an empty list.
+ * @param returnValueHandlers the list of custom handlers (initially an empty list)
*/
protected void addReturnValueHandlers(List This method cannot be overridden; use {@link #configureMessageConverters} instead.
+ * Also see {@link #addDefaultHttpMessageConverters} for adding default message converters.
*/
protected final List Adding converters to the list turns off the default converters that would
+ * otherwise be registered by default. Also see {@link #addDefaultHttpMessageConverters}
+ * for adding default message converters.
+ * @param converters a list to add message converters to (initially an empty list)
*/
protected void configureMessageConverters(List Note: This method cannot be made final due to CGLib
- * constraints. Rather than overriding it, consider overriding
- * {@link #configureHandlerExceptionResolvers(List)}, which allows
- * providing a list of resolvers.
+ * Returns a {@link HandlerExceptionResolverComposite} containing a list of exception
+ * resolvers obtained either through {@link #configureHandlerExceptionResolvers} or
+ * through {@link #addDefaultHandlerExceptionResolvers}.
+ * Note: This method cannot be made final due to CGLIB constraints.
+ * Rather than overriding it, consider overriding {@link #configureHandlerExceptionResolvers}
+ * which allows for providing a list of resolvers.
*/
@Bean
public HandlerExceptionResolver handlerExceptionResolver() {
@@ -900,21 +888,20 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
/**
* Override this method to configure the list of
- * {@link HandlerExceptionResolver}s to use. Adding resolvers to the list
- * turns off the default resolvers that would otherwise be registered by
- * default. Also see {@link #addDefaultHandlerExceptionResolvers(List)}
+ * {@link HandlerExceptionResolver HandlerExceptionResolvers} to use.
+ * Adding resolvers to the list turns off the default resolvers that would otherwise
+ * be registered by default. Also see {@link #addDefaultHandlerExceptionResolvers}
* that can be used to add the default exception resolvers.
- * @param exceptionResolvers a list to add exception resolvers to;
- * initially an empty list.
+ * @param exceptionResolvers a list to add exception resolvers to (initially an empty list)
*/
protected void configureHandlerExceptionResolvers(List This may be useful for example to allow default resolvers to be registered
+ * and then insert a custom one through this method.
* @param exceptionResolvers the list of configured resolvers to extend.
* @since 4.3
*/
@@ -922,7 +909,8 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
}
/**
- * A method available to subclasses for adding default {@link HandlerExceptionResolver}s.
+ * A method available to subclasses for adding default
+ * {@link HandlerExceptionResolver HandlerExceptionResolvers}.
* Adds the following exception resolvers:
*
*