Above is the schematic diagram of SPRINGMVC's work:
1. The client sends an HTTP request to the Web Server, which parses the HTTP request. If the request mapping path (specified in Web. xml) matches the Dispatcherservlet, the Web container will forward the request to Dispatcherservlet.
2.Dipatcherservlet receives this request will be based on the requested information (including URL, HTTP method, request packet header and request parameter cookie, etc.) and handlermapping Configuration to find the processor that processed the request (Handler).
3-4,Dispatcherservlet according to handlermapping find the corresponding Handler, will handle the right to Handler (Handler the specific processing to encapsulate), and then by the specific handleradapter to the Handler to make a specific call.
5,Handler will return a Modelandview () object to Dispatcherservletafter the data processing is completed.
6.Handler return modelandview() Just a logical view is not a formal view, dispatchersevlet through viewresolver turn a logical view into a real view View .
7, dispatcher through the model to parse out the parameters in the Modelandview () and finally show the full view and return
SPRINGMVC Working principle