Set the ApplicationContext prop of ExceptionResolver

The MVC Java config now sets the ApplicationContext property of
ExceptionHandlerExceptionResolver.

Issue: SPR-9997
This commit is contained in:
Rossen Stoyanchev
2012-11-23 15:12:52 -05:00
parent e3681c107d
commit 2d8bacace7
2 changed files with 20 additions and 7 deletions

View File

@@ -629,6 +629,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
*/
protected final void addDefaultHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
ExceptionHandlerExceptionResolver exceptionHandlerExceptionResolver = new ExceptionHandlerExceptionResolver();
exceptionHandlerExceptionResolver.setApplicationContext(this.applicationContext);
exceptionHandlerExceptionResolver.setContentNegotiationManager(mvcContentNegotiationManager());
exceptionHandlerExceptionResolver.setMessageConverters(getMessageConverters());
exceptionHandlerExceptionResolver.afterPropertiesSet();