Search in sources :

Example 1 with ActionInterceptor

use of org.springframework.data.document.web.servlet.ActionInterceptor in project spring-data-document-examples by spring-projects.

the class HandlerAdapterConfiguration method annotationMethodHandlerAdapter.

@Bean
public AnnotationMethodHandlerAdapter annotationMethodHandlerAdapter() {
    AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter();
    ActionInterceptor[] interceptors = new ActionInterceptor[] { datastoreInterceptor };
    //adapter.setActionInterceptors(interceptors);
    ConfigurableWebBindingInitializer wbi = new ConfigurableWebBindingInitializer();
    wbi.setValidator(getValidator());
    wbi.setConversionService(conversionService());
    adapter.setWebBindingInitializer(wbi);
    adapter.setMessageConverters(getMessageConverters());
    adapter.setOrder(-1);
    return adapter;
}
Also used : ConfigurableWebBindingInitializer(org.springframework.web.bind.support.ConfigurableWebBindingInitializer) ActionInterceptor(org.springframework.data.document.web.servlet.ActionInterceptor) AnnotationMethodHandlerAdapter(org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter) FormattingConversionServiceFactoryBean(org.springframework.format.support.FormattingConversionServiceFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean)

Aggregations

Bean (org.springframework.context.annotation.Bean)1 ActionInterceptor (org.springframework.data.document.web.servlet.ActionInterceptor)1 FormattingConversionServiceFactoryBean (org.springframework.format.support.FormattingConversionServiceFactoryBean)1 LocalValidatorFactoryBean (org.springframework.validation.beanvalidation.LocalValidatorFactoryBean)1 ConfigurableWebBindingInitializer (org.springframework.web.bind.support.ConfigurableWebBindingInitializer)1 AnnotationMethodHandlerAdapter (org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter)1