architectural diagram
"Component description"
The following components typically provide implementations using the framework:
1.DisPatcherServlet: Front-end controller (no programmer development required)
The user request arrives at the front controller, architectural diagram which is equivalent to C (Controller) in MVC mode, and Dispatcherservlet is the center of the whole process control, which calls other components to process the user's request. The presence of dispatcherservlet reduces the coupling between components.
Function: As an acceptance request, the corresponding result, equivalent to the transponder, the central processing unit, reduce the coupling between the other components.
2.HandlerMapping: software architecture diagram Processor mapper (no programmer development required)
Handlermapping is responsible for the user request to find handler (i.e.: processor), SPRINGMVC provides different mapper implementation of different mapping methods, such as: Configuration file mode, implementation interface, annotation method.
Function: Find handler based on the URL requested
3.HandLer: Processor (programmer development Required)
Handler is the back-end controller of the Dispatcherservlet front-end controller, under the control of Dispatcherservlet, aws architecture diagram handler the specific user request processing.
Because handler is designed to specific user business requests, the general situation requires programmers to develop handler based on business requirements.
Note: Write handler in accordance with handleradpter requirements to do so that you can go to the correct execution of handler.
4.HandlerAdapter: Processor Adapter
The processor is executed through the Handleradapter, system architecture diagram which is an application of the adapter pattern that can be performed on more types of processors through the extension adapter.
Function: Follow a specific rule (handleradapter required rules) to perform handler
5.ViewResolver: View parser (no programmer development required)
Viewresolver is responsible for generating the results of the View view, Viewresolver First resolves to the physical view name according to the logical view name, that is, the specific page address, then generate the View object, and finally render the view to the user through the display of the results of the page. The SPRINGMVC Framework provides many view view types, including: Jstlview, Freemarkerview, Pdfview, and so on.
Function: Parse the view and parse it into a real view based on the logical view name.
6.View View (requires programmer to develop JSP)
View is an interface that implements classes that support different view types (JSP, Freemarker, pdf)
In general, you need to use page labels or page template technology to display the model data to the user through the page, the programmer needs to develop specific pages according to business needs.
Flowchart
"Flowchart description"
1. The user sends the request to the front controller Dispatcherservlet.
2. The Front controller Dispatcherservlet calls the processor mapper handlermappingwhen the request is received.
3. Processor Mapper Handlermapping find the specific processor based on the requested URL, generate Processor object Handler and processor Interceptor Handlerintercepter (if any) is returned to the front controller Dispatcherservlet.
4. The Front controller Dispatcherservlet calls the processor controllerthrough the processor adapter Handleradapter .
5. Execution Processor (Controller, also called back-end controller)
6. When the processor controller finishes executing, return to Modelandview.
7. The processor Mapper Handleradapter Returns the processor controller execution Modelandview back to the front controller Dispatcherservlet.
8. Front controller Dispatcherservlet passes Modelandview to the view parser Viewresolver.
9. The view resolver Viewresolver parse to return to the specific viewsview.
Front Controller Dispatcherservlet View view ( that is, populate the model data into the view)
The front-end controller Dispatcherservlet responds to the user.
(Note the color)
SPRINGMVC Process Architecture Diagram