- @EnableWebMvc어노테이션을 사용하면 Spring Framework에서 여러 Config값을 알아서 세팅해준다.
왜?
- @EnableWebMvc -> DelegatingWebMvcConfiguration -> WebMvcConfigurationSupport 이렇게 타고 들어 갈 수 있다.
- WebMvcConfigurationSupport를 보면 많은 설정이 있는데 여기에서 제공하는 정보를 사용한다.
- WebMvcConfigurer을 사용하면 @EnableWebMvc의 정보를 customizing할 수 있다.
참조
@EnableWebMvc
WebMvcConfigurer
정리
스프링부트에서는 @EnableWebMvc를 쓰지 말자.
이러면 스프링부트의 기본적인 웹 MVC기능들을 사용하지 못한다.