SPRING3 MVC structure is simple, should the sentence simple is beautiful, and he is powerful and flexible, easy to expand, performance is also excellent. He's got the same idea as Struts2. There is a front-end interceptor for request forwarding, except that Struts2 is filter,spring MVC is a servlet, but spring MVC is very simple either learning or using.
This is the core flowchart of Spring3 MVC:
Spirngmvc the first extension point
Handlermapping interface--mapping for processing requests
To save the mapping relationship between the request URL and the specific method, we can write any handlermapping implementation class that determines the generation of a Web request to a Handlerexecutionchain object based on any policy.
Spirngmvc the second extension point
Handlerinterceptor Connector--Interceptor
Handlerinterceptor, by customizing the Interceptor, we can do whatever we want after a request is actually processed, the request is processed but not yet output to the response, and the request has been output to the response three points.
Spirngmvc the third extension point
Handleradapter Interface – Processing adapters
The real call controller place, in fact, is suitable for all kinds of controller. Handleradapter is that you can provide your own implementation class to handle handler objects.
Spirngmvc the fourth extension point
Handlermethodargumentresolver--processing method parameter interpreter binding device
Before calling the Controller method, the method parameters are interpreted binding (implement the Webargumentresolver interface, spring3.1 recommended to use handlermethodargumentresolver later);
Spirngmvc the fifth extension point
Converter--type converter
Parameter Binding timing SPRINGMVC will automatically convert the parameters from the front to the type of the parameter defined by the method, and we can define this interface ourselves to implement our own type of conversion.
The sixth extension point of the Spirngmvc
Viewresolver Interface – View parser
completes the process from Modelandview to the real view, the Viewresolver interface is invoked in Dispatcherservlet, When Dispatcherservlet calls the controller, a Modelandview object is obtained, and Dispatcherservlet calls the Render method for view rendering.
Springmvc the seventh extension point provided:
Handlerexceptionresolver interface--Exception handling