Description
The following line:
does say (specifically but without @EnableWebMvc) :
If you want to keep those Spring Boot MVC customizations and make more {spring-framework-docs}/web.html#mvc[MVC customizations] (interceptors, formatters, view controllers, and other features), you can add your own
@Configuration
class of typeWebMvcConfigurer
but without@EnableWebMvc
.
IMO this should be made explicitly crystal clear as to why? Something along the lines of:
If you have a configuration with
@EnableWebMvc
in your Springboot application that basically instantiates the Spring WebMVC beanDelegatingWebMvcConfiguration
which extendsWebMvcConfigurationSupport
and that trips/fails the@ConditionalOnMissingBean(WebMvcConfigurationSupport.class)
annotation onWebMvcAutoConfiguration
and it backs off.
I think many users read the section:
which seems to tell them to turn on @EnableWebMvc
.
I think @EnableWebMvc
disabling the Spring Boots MVC autoconfiguration comes across as a confusing double negative to new users.
Once one understands what is going on it makes sense, but I got tripped by it and have seen issues filed and many SO entries.