Spring MVC
Spring web is all about MVC architecture. It also allows us to create flexible and loosely coupled web application.
It is a very well known design pattern to develop web application.
Model → This is responsible for maintaining data. e.g. bean or model class.
View → It is a representation of the end result to output or show on the on the page. e.g. JSP, HTML etc.
Controller → Controller is a backend code which gets trigger on performing any action or user input.
The browser will call the controller as shown in the below inline diagram. The controller will decide whether to call view or model.
1st Scenario → The browser will call the controller and, depending on input data, the model will call the database as it is tightly coupled using JPA or Hibernate. On getting a response back from the database, the model will call view to output data on the browser output screen.
2nd Scenario → The browser will call the controller and, depending on the input data, the view will call the database as it is tightly coupled using JPA or Hibernate. On getting a response back from the database, the view will output data on the browser output screen.
Mode can get request to return data from both View and Controller.
Imran Khan, Adobe Community Advisor, AEM certified developer and Java Geek, is an experienced AEM developer with over 11 years of expertise in designing and implementing robust web applications. He leverages Adobe Experience Manager, Analytics, and Target to create dynamic digital experiences. Imran possesses extensive expertise in J2EE, Sightly, Struts 2.0, Spring, Hibernate, JPA, React, HTML, jQuery, and JavaScript.