1. Core controller (front controller, pre-processor controller): This word should not be unfamiliar to people who have used the MVC framework, the main purpose of the core controller is to handle all requests, and then treat the special requests (Controller) uniformly (character encoding, file upload, parameter acceptance, exception handling, etc.) , the spring MVC Core controller is a servlet, and Struts2 is the filter. Filter can be seen as a servlet chain (a chain of multiple servlets).
2. Controller instance: Spring MVC will be faster (theoretically) than struts. Spring MVC is based on method design, and Sturts is Object-based, each time a request is made, an action is instantiated, each action is injected into a property, and spring is more like a servlet, with only one instance, each request executes the corresponding method ( Note: Because it is a singleton instance, you should avoid modifying the global variables, which can lead to thread safety issues.
3. Management: Most of the company's core architecture will be used to spring, and Spring MVC is a module in spring, so spring for the management of spring MVC is simpler and more convenient, and provides a full annotated way to manage, Annotations for various functions are comprehensive, simple to use, and struts2 need to be managed with a lot of XML configuration parameters (although annotations can be used, but few companies do).
4. Parameter passing: Struts2 in the self provides a variety of parameters to accept, in fact, are passed through (valuestack) and assignment, and SPRINGMVC is through the parameters of the method to receive.
5. Learning Difficulty: Struts more new technology points, such as interceptors, value stacks and ognl expressions, learning costs are higher, SPRINGMVC is relatively simple, very little time to get started.
6.intercepter implementation mechanism: Struts has its own interceptor mechanism, and spring MVC uses an independent AOP approach. This leads to the profile of struts is still larger than spring MVC, although the configuration of struts can inherit, so I think in terms of use, Spring MVC use more concise, development efficiency Spring MVC is really higher than struts2. Spring MVC is a method-level intercept, a method that corresponds to a request context, and a method that corresponds to a URL, so it is easy to implement a restful URL spring3 mvc from the schema itself. STRUTS2 is class-level interception, a class corresponds to a request context, and implementing a restful URL is laborious because a method of struts2 action can correspond to a URL, and its class properties are shared by all methods. It is also not possible to identify the method that it belongs to by annotations or other means. Spring3 MVC method is basically independent, the request response data, requests data through parameters, processing results through the MODELMAP to the framework method is not shared between the variables, and struts2 make is more chaotic, although the method is also independent, But all of its action variables are shared, which does not affect the program's operation, but it gives us code and trouble reading the program.
7.spring MVC handles AJAX requests directly by returning data, using annotations in methods @responsebody,spring MVC automatically transforms our objects into JSON data.
Comparison of struts and SPRINGMVC