List of usage examples for org.springframework.web.servlet.mvc.method.annotation ServletInvocableHandlerMethod ServletInvocableHandlerMethod
public ServletInvocableHandlerMethod(Object handler, Method method)
From source file:od.controller.tests.ControllerTests.java
protected ExceptionHandlerExceptionResolver createExceptionResolver() { ExceptionHandlerExceptionResolver exceptionResolver = new ExceptionHandlerExceptionResolver() { @Override/*from w w w . j a va 2 s . c o m*/ protected ServletInvocableHandlerMethod getExceptionHandlerMethod(HandlerMethod handlerMethod, Exception exception) { Method method = new ExceptionHandlerMethodResolver(AppControllerAdvice.class) .resolveMethod(exception); return new ServletInvocableHandlerMethod(new AppControllerAdvice(), method); } }; exceptionResolver.getMessageConverters().add(new MappingJackson2HttpMessageConverter()); exceptionResolver.afterPropertiesSet(); return exceptionResolver; }
From source file:org.exoplatform.acceptance.rest.administration.credential.CredentialCRUDControllerTest.java
private ExceptionHandlerExceptionResolver createExceptionResolver() { ExceptionHandlerExceptionResolver exceptionResolver = new ExceptionHandlerExceptionResolver() { protected ServletInvocableHandlerMethod getExceptionHandlerMethod(HandlerMethod handlerMethod, Exception exception) { Method method = new ExceptionHandlerMethodResolver(JsonErrorHandler.class).resolveMethod(exception); return new ServletInvocableHandlerMethod(jsonErrorHandler, method); }/*from w w w. j a va2s . c o m*/ }; List<HttpMessageConverter<?>> messageConverters = new ArrayList<>(); messageConverters.add(new FormHttpMessageConverter()); messageConverters.add(new StringHttpMessageConverter()); messageConverters.add(new MappingJackson2HttpMessageConverter()); exceptionResolver.setMessageConverters(messageConverters); exceptionResolver.afterPropertiesSet(); return exceptionResolver; }