1: Spring3 mvc development efficiency is higher than struts 2: spring3 mvc can be considered 100% zero configuration 3: struts2 is a class-level interception, a class corresponds to a request context, springmvc is a method-level interception, a method corresponds to a request context, and a method corresponds to a url at the same time So from the architecture itself, spring3 mvc is easy to implement restful url The struts2 architecture is difficult to implement Because a method of struts2 action can correspond to a url However, its class attributes are shared by all methods, so it is impossible to use annotations or other methods to identify the method to which it belongs. 4: The methods of spring3mvc are basically independent, with exclusive request response data The request data is obtained through parameters, and the processing results are returned to the framework through ModelMap Variables are not shared between methods And struts2 is more messy, although the methods are independent, but all its Action variables are shared This will not affect the operation of the program, but it will cause trouble when we code and read the program 5: Since Struts2 needs to encapsulate each Request, the variables of the Servlet life cycle such as Request and Session are encapsulated into a Map, which is provided to each Action and ensures thread safety . So in principle, it is more memory-intensive.
Analysis of characteristics of springmvc and struts
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326546463&siteId=291194637
Recommended
Ranking