Spring MVC Architecture diagram with Explanation




Hey guys in this post, you will learn about Spring MVC and its architectural diagram with flow diagram.

Read More:

What is Spring MVC?


  • Spring MVC is a framework for building web applications in Java
  • It is based on the Model-View-Control design pattern
  • It leverages features of the core Spring framework such as Inversion of control and dependency injection

Model-View-Controller


Below is the architectural flow diagram of Spring MVC

mvc

  • Browser sends a request to the server. Server takes that request, process it and send it to the Front controller
  • Front controller is a Dispatcher Servlet, its the job is the send the request to the appropriate controller
  • Controller code is the one written by developers, which contains the business logic
  • Controller will then prepare the model and send it to the Front controller for further processing
  • Front controller then send that model to the view template, which is contains the HTML code and data which needs to be displayed in the web page.

Controller


  • Controller classes are created by developers
  • Contains business logic and it handles the request
  • It store and retrieve the data from database and other services
  • It will write the data to the model
  • It will send the data to the appropriate view template

Model


  • Model is just a java object contains the data
  • It will help us the store and retrieve the data from database or web service

View Template


  • Spring MVC is flexible, it supports many view templates
  • Most commonly used view templates are JSP and Thymeleaf
  • Developer creates the view template to display the data present in Model

Spring MVC Benifits


  • It is the best way of building web applications in Java
  • It leverages a set of reusable UI components
  • It will help us to manage application state for web requests
  • It process the form data by validating, converting etc,
  • It is very flexible to configure the view layer with other view templates.

Additional Resources


That’s it for this post, if you like this post, please share this post with your friends and collogues and also share this on your social media profiles.



Bushan Sirgur

Hey guys, I am Bushan Sirgur from Banglore, India. Currently, I am working as an Associate project in an IT company.

Leave a Reply