Skip to content

Commit ffe9bae

Browse files
committed
Update Javadoc on exception resolvers in MVC config
Issue: SPR-15324
1 parent 020e51c commit ffe9bae

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,29 @@ public interface WebMvcConfigurer {
167167
void extendMessageConverters(List<HttpMessageConverter<?>> converters);
168168

169169
/**
170-
* Configure the {@link HandlerExceptionResolver}s to handle unresolved
171-
* controller exceptions. If no resolvers are added to the list, default
172-
* exception resolvers are added instead.
170+
* Configure exception resolvers.
171+
* <p>The given list starts out empty. If it is left empty, the framework
172+
* configures a default set of resolvers, see
173+
* {@link WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List)}.
174+
* Or if any exception resolvers are added to the list, then the application
175+
* effectively takes over and must provide, fully initialized, exception
176+
* resolvers.
177+
* <p>Alternatively you can use
178+
* {@link #extendHandlerExceptionResolvers(List)} which allows you to extend
179+
* or modify the list of exception resolvers configured by default.
173180
* @param exceptionResolvers initially an empty list
181+
* @see #extendHandlerExceptionResolvers(List)
182+
* @see WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List)
174183
*/
175184
void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers);
176185

177186
/**
178-
* A hook for extending or modifying the list of {@link HandlerExceptionResolver}s
179-
* after it has been configured. This may be useful for example to allow default
180-
* resolvers to be registered and then insert a custom one through this method.
187+
* Extending or modify the list of exception resolvers configured by default.
188+
* This can be useful for inserting a custom exception resolver without
189+
* interfering with default ones.
181190
* @param exceptionResolvers the list of configured resolvers to extend
182191
* @since 4.3
192+
* @see WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List)
183193
*/
184194
void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers);
185195

0 commit comments

Comments
 (0)