Spring Web MVC framework Introduction
By AmarSivas | | Updated : 2018-11-14 | Viewed : 565 times
Table of Contents:
Spring Web MVC Framework introduction
In developing of web applications, we can used different type of frameworks. But framework should be easy to use. By using the spring, we can easily implement and develop all three layers (Model, View and model) in application. The Spring Web MVC uses the MVC design pattern. The main goal of this design pattern is separation of all three (Model, view and controller) components. So the use of separation of these three layers, the enhancement will be very easy. Spring Web MVC framework provides features are view resolution, command object, validation and many more.
MVC Design Pattern Overview
MVC Design pattern will be used in implementation of web applications. This is architectural design pattern that will decouple components as Model, View and Controller. By using this decoupling technique, web application development and enhancement will be very easy. These decoupled components will be used as reusable components.
Model in MVC: Model contains responded output, which will be presented in the View page. The model will send by Controller to the View.
View in MVC: The view will be responsible for presenting the response data in UI. After processing the request input, the response will be displayed in View (UI).
Controller in MVC: The Controller will respond to the request from UI and will delegate control to the service for processing the request. Here Service will make Persistence components involve for processing the data. While processing the request Persistence component/class will communicate with database. After processing the data, the data will be populated in the View i.e., UI.
Please find the below given diagram for MVC design pattern work flow.
In step 1, the Request will send to server for processing. In step 2, the request will be processed. In processing request, the controller will take help other (Service) resources for processing. In step 3, the responded output will be converted as Model to populate the model in the View.in step 4, the data will be displayed in the view.
Spring5 Web MVC Framework Features
Separations of Roles: All important spring web MVC components/Roles defined with specialized object
Powerful Configuration: Spring5 Web MVC provides a powerful configuration for framework and application classes. By using, we can easily get reference for all type of spring beans across the spring context.
Spring5 Web MVC provides the feature for writing the controller classes with more options to read requested input.
By using the Spring5 Web MVC, we can avoid duplication of business objects such as command/form objects.
The latest Spring5 Web MVC is allows for binding and validation’s customization. In binding, we can convert requested form values into business objects.
Spring Web MVC provided customization for resolution of view and handler mapping. It provides customization of locales, time zone and theme resolution also.
Please find below given features