use of org.hisp.dhis.webapi.mvc.CustomRequestMappingHandlerMapping in project dhis2-core by dhis2.
the class MvcTestConfig method requestMappingHandlerMapping.
@Bean
public CustomRequestMappingHandlerMapping requestMappingHandlerMapping(FormattingConversionService mvcConversionService, ResourceUrlProvider mvcResourceUrlProvider) {
CustomPathExtensionContentNegotiationStrategy pathExtensionNegotiationStrategy = new CustomPathExtensionContentNegotiationStrategy(mediaTypeMap);
pathExtensionNegotiationStrategy.setUseRegisteredExtensionsOnly(true);
ContentNegotiationManager manager = new ContentNegotiationManager(Arrays.asList(pathExtensionNegotiationStrategy, new HeaderContentNegotiationStrategy(), new FixedContentNegotiationStrategy(MediaType.APPLICATION_JSON)));
CustomRequestMappingHandlerMapping mapping = new CustomRequestMappingHandlerMapping();
mapping.setOrder(0);
mapping.setContentNegotiationManager(manager);
TestInterceptorRegistry registry = new TestInterceptorRegistry();
addInterceptors(registry);
registry.addInterceptor(new ConversionServiceExposingInterceptor(mvcConversionService));
registry.addInterceptor(new ResourceUrlProviderExposingInterceptor(mvcResourceUrlProvider));
mapping.setInterceptors(registry.getInterceptors().toArray());
return mapping;
}
use of org.hisp.dhis.webapi.mvc.CustomRequestMappingHandlerMapping in project dhis2-core by dhis2.
the class WebMvcConfig method createRequestMappingHandlerMapping.
@Override
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
CustomRequestMappingHandlerMapping mapping = new CustomRequestMappingHandlerMapping();
mapping.setOrder(0);
mapping.setContentNegotiationManager(mvcContentNegotiationManager());
return mapping;
}
Aggregations