Example usage for org.springframework.web.servlet.mvc.method.annotation ExceptionHandlerExceptionResolver afterPropertiesSet

List of usage examples for org.springframework.web.servlet.mvc.method.annotation ExceptionHandlerExceptionResolver afterPropertiesSet

Introduction

In this page you can find the example usage for org.springframework.web.servlet.mvc.method.annotation ExceptionHandlerExceptionResolver afterPropertiesSet.

Prototype

@Override
    public void afterPropertiesSet() 

Source Link

Usage

From source file:org.lightadmin.core.config.context.LightAdminContextConfiguration.java

@Override
public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
    ExceptionHandlerExceptionResolver exceptionHandlerResolver = new ExceptionHandlerExceptionResolver();
    exceptionHandlerResolver.setCustomArgumentResolvers(
            Arrays.<HandlerMethodArgumentResolver>asList(new ServerHttpRequestMethodArgumentResolver()));
    exceptionHandlerResolver.afterPropertiesSet();

    exceptionResolvers.add(exceptionHandlerResolver);
}

From source file:od.controller.tests.ControllerTests.java

protected ExceptionHandlerExceptionResolver createExceptionResolver() {
    ExceptionHandlerExceptionResolver exceptionResolver = new ExceptionHandlerExceptionResolver() {
        @Override/*w ww .j av  a  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  . ja va  2 s.  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;
}