1.) What is Spring MVC framework?
1.1.) Spring MVC provides Model, View and Controller Architecture.
a. Model – Manages the Data, logic and rules of the Application.
b. View – can be any output of representation information. JSP page written with the Java Standard Tag Library (JSTL).
c. Controller – Accepts Input and convert it to commands for the Model or View. URL mapping and interact with service layer for business processing and return a Model.
1.2.) Spring MVC patterns results in separating diff aspects of the application ( input logic, business logic, and UI Logic) .
1.3.) Providing a loose coupling between model, vew & controller of Application.
1.4.) Spring is light weight and layer architecture framework which can be used to build complex enterprise applications.
1.5.) Spring Provides a front Controller Servlet named DispactherServlet. to build an Appl. Below description About DispatcherServlet.
- One and More Controllers that invoke business logic and Create a ModelAndView Object.
- A visualization components such as JSP.
- XML or Annotation configuration to Wire the Components together.
1.6.) Spring provides various controllers for you to use as base classes for creating your own controllers, depending on your needs. Below is the Descriptions:
- Redirect to static views
- Provide basic servlet-like functionality
- Process commands
- Process shared actions
- Handle forms
- Provide wizard-like functionality to process multipage forms
1.7.) Spring MVC Architecture Diagram.
=> Description on Spring MVC Diagram :
( 1 ) – First Request will be received by DispatcherServlet.
( 2 ) – DispatcherServlet will take the help Handler Mapping & Get to know the Controller Class name Associated with the Given Request , so request tranfer to the Controller.
( 3 ) – Controller will process the request by executing appropriate methods & returns ModelAndView Object (Contains Model data & View Name) back to DispatcherServlet.
( 4 ) – The Front Controller then tries to resolve the View ( Which can be JSP, Free Marker, Velocity) by Consulting the Resolver Objects.
( 5 ) – The Selected View is then rendered.
( 6 ) – Rendered View Back to Client.