Spring MVC

Pragmatically Spring MVC example without using XML (Pure java based configuration)

After we have the Servlet 3 version, we have the option to ignore the web.xml file in our java based web application. Similarly, Spring gives us the option to ignore its XML based configuration in new releases. So, you can create the Spring MVC application without having any xml file in it. See the Example.

Here the java code to create the Web application initializer. Implementation of WebApplicationInitializer interface gives the provision to provide the configuration that would have in web.xml file

Tags