Loading

Spring MVC-Multiple Controller

  • In Spring MVC, we can create multiple controllers and map each controller class with the @Controller annotation. Here is an example of multiple controllers in Spring MVC.

The steps are as follows:

  • In the case of Maven, load the Spring Jar files or add dependencies.
  • Make your controller class.
  • Provide a controller entry in the web.xml file.
  • In a separate XML file define the bean
  • Make the rest of the view components.
  • start the server and make the project available.