When you're using Java code (as opposed to XML) to configure your Spring application, @EnableWebMvc is used to enable Spring MVC. If you're not already familiar with Spring's support for Java configuration, this is a good place to start.
@EnableWebMvc is equivalent to <mvc:annotation-driven /> in XML. It enables support for @Controller-annotated classes that use @RequestMapping to map incoming requests to a certain method. You can read detailed information about what it configures by default and how to customise the configuration in the reference documentation.
When we want to build a Spring Web MVC project we need to add necessary import from WebMvcConfigurationSupport.For that reason, we should use @EnableWebMvc in java based configuration. Only one @Configuration class may have @EnableWebMvc.