Perform the following to build a simple Spring MVC project using the JavaConfig specification:
- Create the JavaConfig root context through implementing the abstract class org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter. It has the @Configuration annotation and contains methods that can be overridden to manage validators, view resolvers, controllers, interceptors, and other MVC-specific components needed to be injected to the container. Let us name the implementation class SpringDispatcherConfig and place it inside the org.packt.starter.ioc.dispatcher package:
@Configuration
public class SpringDispatcherConfig extends
WebMvcConfigurerAdapter{ }
- Let us now configure the DispatcherServlet. The implementation ...