* <li>{@link DefaultHandlerExceptionResolver}
* for resolving known Spring exception types
* </ul>
*/
protected final void addDefaultHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
ExceptionHandlerExceptionResolver exceptionHandlerExceptionResolver = new ExceptionHandlerExceptionResolver();
exceptionHandlerExceptionResolver.setContentNegotiationManager(mvcContentNegotiationManager());
exceptionHandlerExceptionResolver.setMessageConverters(getMessageConverters());
if (jackson2Present) {
List<ResponseBodyAdvice<?>> interceptors = new ArrayList<ResponseBodyAdvice<?>>();
interceptors.add(new JsonViewResponseBodyAdvice());
exceptionHandlerExceptionResolver.setResponseBodyAdvice(interceptors);
}
exceptionHandlerExceptionResolver.setApplicationContext(this.applicationContext);
exceptionHandlerExceptionResolver.afterPropertiesSet();
exceptionResolvers.add(exceptionHandlerExceptionResolver);
ResponseStatusExceptionResolver responseStatusExceptionResolver = new ResponseStatusExceptionResolver();
responseStatusExceptionResolver.setMessageSource(this.applicationContext);
exceptionResolvers.add(responseStatusExceptionResolver);