@ -33,6 +33,7 @@ import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException ;
import org.springframework.beans.factory.ObjectProvider ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Qualifier ;
import org.springframework.boot.autoconfigure.AutoConfigureAfter ;
import org.springframework.boot.autoconfigure.AutoConfigureOrder ;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration ;
@ -362,10 +363,11 @@ public class WebMvcAutoConfiguration {
@Bean
@Override
public RequestMappingHandlerAdapter requestMappingHandlerAdapter (
ContentNegotiationManager mvcContentNegotiationManager ,
FormattingConversionService mvcConversionService , Validator mvcValidator ) {
RequestMappingHandlerAdapter adapter = super . requestMappingHandlerAdapter ( mvcContentNegotiationManager ,
mvcConversionService , mvcValidator ) ;
@Qualifier ( "mvcContentNegotiationManager" ) ContentNegotiationManager contentNegotiationManager ,
@Qualifier ( "mvcConversionService" ) FormattingConversionService conversionService ,
@Qualifier ( "mvcValidator" ) Validator validator ) {
RequestMappingHandlerAdapter adapter = super . requestMappingHandlerAdapter ( contentNegotiationManager ,
conversionService , validator ) ;
adapter . setIgnoreDefaultModelOnRedirect (
this . mvcProperties = = null | | this . mvcProperties . isIgnoreDefaultModelOnRedirect ( ) ) ;
return adapter ;
@ -383,11 +385,12 @@ public class WebMvcAutoConfiguration {
@Primary
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping (
ContentNegotiationManager mvcContentNegotiationManager ,
FormattingConversionService mvcConversionService , ResourceUrlProvider mvcResourceUrlProvider ) {
@Qualifier ( "mvcContentNegotiationManager" ) ContentNegotiationManager contentNegotiationManager ,
@Qualifier ( "mvcConversionService" ) FormattingConversionService conversionService ,
@Qualifier ( "mvcResourceUrlProvider" ) ResourceUrlProvider resourceUrlProvider ) {
// Must be @Primary for MvcUriComponentsBuilder to work
return super . requestMappingHandlerMapping ( mv cC ontentNegotiationManager, mv cC onversionService,
mvcR esourceUrlProvider) ;
return super . requestMappingHandlerMapping ( contentNegotiationManager, conversionService,
r esourceUrlProvider) ;
}
@Bean