Search⌘ K
AI Features

Spring MVC

Learn to understand the Spring MVC framework by exploring its front controller design pattern, the role of DispatcherServlet, controllers with @Controller annotations, and request mappings. Discover how to configure Spring MVC applications using XML or Java and how to handle HTTP requests with shortcut annotations. This lesson helps you gain foundational knowledge for developing web applications using Spring MVC.

What is Spring MVC?

Spring MVC is the module of Spring that implements the front controller and MVC design pattern. It provides a decoupled approach to developing web applications.

In Spring MVC, the three components of the MVC architecture, the front controller, view resolver and model are not dependent on each other. All incoming requests are handled by the front controller which is called the DispatcherServlet.

What are the advantages of using Spring MVC?

  • Spring MVC is based on interfaces which are independent of each other allowing separation of concerns.
  • Because there is no explicit dependency between the interfaces, Spring MVC applications are easily testable.
  • The view technology is customizable and switching between JSP, Velocity or Thymeleaf etc. can be done easily.
  • Spring MVC supports RESTful web services.

What is the flow of request in the MVC architecture?

The ...