use of org.springframework.web.servlet.function.support.RouterFunctionMapping in project spring-framework by spring-projects.
the class WebMvcConfigurationSupport method routerFunctionMapping.
/**
* Return a {@link RouterFunctionMapping} ordered at 3 to map
* {@linkplain org.springframework.web.servlet.function.RouterFunction router functions}.
* Consider overriding one of these other more fine-grained methods:
* <ul>
* <li>{@link #addInterceptors} for adding handler interceptors.
* <li>{@link #addCorsMappings} to configure cross origin requests processing.
* <li>{@link #configureMessageConverters} for adding custom message converters.
* <li>{@link #configurePathMatch(PathMatchConfigurer)} for customizing the {@link PathPatternParser}.
* </ul>
* @since 5.2
*/
@Bean
public RouterFunctionMapping routerFunctionMapping(@Qualifier("mvcConversionService") FormattingConversionService conversionService, @Qualifier("mvcResourceUrlProvider") ResourceUrlProvider resourceUrlProvider) {
RouterFunctionMapping mapping = new RouterFunctionMapping();
mapping.setOrder(3);
mapping.setInterceptors(getInterceptors(conversionService, resourceUrlProvider));
mapping.setCorsConfigurations(getCorsConfigurations());
mapping.setMessageConverters(getMessageConverters());
PathPatternParser patternParser = getPathMatchConfigurer().getPatternParser();
if (patternParser != null) {
mapping.setPatternParser(patternParser);
}
return mapping;
}
Aggregations