A single object or a group of objects might be considered data. A controller is where an application's business logic is stored, and the @Controller annotation is used to designate the class as the controller in this case. A view is a representation of the given data in a particular format.
Model-View-Controller (MVC) architecture and optimal components are provided with the Spring Web MVC framework, which can create flexible and freely connected web applications. The MVC pattern separates the various parts of an application (input logic, business logic, and user interface logic) while maintaining a loose connection between them.
Model: It contains all of the data and the reasoning that goes with it.
Present data to the user or manage user interaction in this view.
A controller is a component that connects the Model and View components.
Let's look at each component in more detail:
A View is the component of an application that represents how data is presented.
The data gathered from the model data is used to build views. A view asks the model for data so that the user may see the resulting presentation.
The view also displays data from charts, diagrams, and tables. Any customer view, for example, will have all UI elements such as text fields, dropdowns, and so on.
The Controller is the component of the program that controls user interaction. The controller interprets the user's mouse and keyboard inputs, which causes the model and view to alter accordingly.
To update the model's state, a Controller delivers commands (E.g., Saving a specific document). In addition, the controller sends orders to its associated view to modify the view's appearance (For example, scrolling a particular manuscript).