diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java index 7e21c63d8a59fdc75eebbc23c493027ddd8dc366..ad3c33c967376d834b81addce2f882f3fc193f35 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java @@ -167,19 +167,29 @@ public interface WebMvcConfigurer { void extendMessageConverters(List> converters); /** - * Configure the {@link HandlerExceptionResolver}s to handle unresolved - * controller exceptions. If no resolvers are added to the list, default - * exception resolvers are added instead. + * Configure exception resolvers. + *

The given list starts out empty. If it is left empty, the framework + * configures a default set of resolvers, see + * {@link WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List)}. + * Or if any exception resolvers are added to the list, then the application + * effectively takes over and must provide, fully initialized, exception + * resolvers. + *

Alternatively you can use + * {@link #extendHandlerExceptionResolvers(List)} which allows you to extend + * or modify the list of exception resolvers configured by default. * @param exceptionResolvers initially an empty list + * @see #extendHandlerExceptionResolvers(List) + * @see WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List) */ void configureHandlerExceptionResolvers(List exceptionResolvers); /** - * A hook for extending or modifying the list of {@link HandlerExceptionResolver}s - * after it has been configured. This may be useful for example to allow default - * resolvers to be registered and then insert a custom one through this method. + * Extending or modify the list of exception resolvers configured by default. + * This can be useful for inserting a custom exception resolver without + * interfering with default ones. * @param exceptionResolvers the list of configured resolvers to extend * @since 4.3 + * @see WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List) */ void extendHandlerExceptionResolvers(List exceptionResolvers);