From da96eeab211444bca34ec05f18a16a2d093cb250 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 21 Feb 2022 17:49:01 +0000 Subject: [PATCH] Remove redundant requestMappingHandlerMapping override The bean no longer needs to be primary so the override is not needed any more. Closes gh-29682 --- .../web/servlet/WebMvcAutoConfiguration.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java index d400b858deb..9f8caed0d90 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java @@ -66,7 +66,6 @@ import org.springframework.context.ResourceLoaderAware; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Primary; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.core.io.Resource; @@ -435,18 +434,6 @@ public class WebMvcAutoConfiguration { return super.createRequestMappingHandlerAdapter(); } - @Bean - @Primary - @Override - public RequestMappingHandlerMapping requestMappingHandlerMapping( - @Qualifier("mvcContentNegotiationManager") ContentNegotiationManager contentNegotiationManager, - @Qualifier("mvcConversionService") FormattingConversionService conversionService, - @Qualifier("mvcResourceUrlProvider") ResourceUrlProvider resourceUrlProvider) { - // Must be @Primary for MvcUriComponentsBuilder to work - return super.requestMappingHandlerMapping(contentNegotiationManager, conversionService, - resourceUrlProvider); - } - @Bean public WelcomePageHandlerMapping welcomePageHandlerMapping(ApplicationContext applicationContext, FormattingConversionService mvcConversionService, ResourceUrlProvider mvcResourceUrlProvider) {