-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify the effect of using @EnableWebMvc
#36506
Comments
Isn't that said two lines below already?
|
Don't get me wrong. Like I said, once one understands what happened then it all makes sense. Those two lines tell the user what to do if they want full control. i.e. they do not want either Spring Boot auto config nor what pure @EnableWebMvc gives them if they do not have a I think the confusion happens when they do not want to take full control but want the Spring boot provided auto configuration and want to add to it and they do: @Configuration
@EnableWebMvc // <--------------------- Mistake
public static class MyAdditions implements WebMvcConfigurer {
// They want add to Springboots Auto config, , but instead they end up adding to Spring MVC provided config.
} |
While I don't think we should go into the level of detail suggested above, I do think we could clarify things by mentioning On the Framework side, there are places in their docs where they mention Spring Boot. The section on |
@wilkinsona I agree about not going into details as I suggested. I was just trying to make it very clear. I like what you are capturing and does address my concern. I think it will save users time, assuming of course they read the docs. And I will file a similar issue for framework because I think users reading their docs and Springboot docs was causing some confusion. |
I suggest a small addition to:
|
Thanks for the suggestion but I think that's covered a few sentences later by the following:
|
@EnableWebMvc
The following line:
https://github.com/spring-projects/spring-boot/blob/07a7ff473b6e97db6f00eb62f4f8beb2fb8da73b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc?plain=1#L45C1-L45C1
does say (specifically but without @EnableWebMvc) :
IMO this should be made explicitly crystal clear as to why? Something along the lines of:
I think many users read the section:
Enable MVC Configuration
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.
The text was updated successfully, but these errors were encountered: