Spring3 MVC simple structure, the sentence should be simple is the United States, and he is strong 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 the filter, Spring MVC is a servlet , but Spring MVC It 's very simple, whether it's learning or using.
This is the core flowchart of Spring3 MVC:
Spirngmvc The first extension point
handlermapping Interface -- mapping of processing requests
Save Request URL to the specific method of the mapping relationship, , we can write arbitrary handlermapping implementation class, based on any policy to determine a Web Request to Handlerexecutionchain the generation of the object.
Spirngmvc The second extension point
Handlerinterceptor Interface -- Interceptor
Handlerinterceptor , by customizing the Interceptor, we can do whatever we want to do after a request is actually processed, the request is processed but not output to the response, and the request has been output to the response after the three point in time.
Spirngmvc The third extension point
handleradapter interface   – processing adapter
really calls Controller handleradapter You can provide your own implementation class to handle handler object.
Spirngmvc The fourth extension point
handlermethodargumentresolver-- processing Method parameter Interpretation Binder
Before invoking the Controller method, the method parameter is interpreted to bind (implement Webargumentresolver interface, spring3.1 recommend using handlermethodargumentresolver later);
Spirngmvc The fifth extension point
Converter--type converter
Parameter binding Springmvc automatically converts the parameters from the front end to the type of the parameter defined by the method, and we can define this interface ourselves to implement our own type of conversion
Spirngmvc Sixth extension Point
viewresolver interface   –   View parser
to complete the process from Modelandview to the real view, the Viewresolver interface is called in Dispatcherservlet, When Dispatcherservlet invokes the controller, it gets a Modelandview object, and Dispatcherservlet calls the Render method to render the view.
Springmvc The seventh extension point provided:
Handlerexceptionresolver interface--Exception handling
Several common extensibility points provided by spring MVC