From the course: Spring: Spring MVC

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Java configuration for Spring MVC

Java configuration for Spring MVC

From the course: Spring: Spring MVC

Start my 1-month free trial

Java configuration for Spring MVC

- [Instructor] Let's go to the next step now. We have to add the Java configuration to bootstrap the DispatcherServlet class. Now the approach that we're going to adopt to in this entire course is that we're going to do all the configuration using either a Java configuration class or with the help of annotations. In a normal web application, you could have bootstrap an external servlet, using WebXML. But WebXML is not something that we're going to go ahead with, so entire bootstrapping of the DispatcherServlet will happen in a Java configuration class that I'm going to write now. So let's do that. On the IDE, let's create a package, here. Let's say com.test. And let's create a class which says ApplicationInitializer. Now this should implement a class which is called WebApplicationInitializer which is coming from the springframework web package. And this is going to provide you all the APIs in order to…

Contents