The difference between springmvc and struts

1:
The development efficiency of spring3 mvc is higher than that of struts
2:
spring3 mvc can be considered to have 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 the method corresponds to a url at the same time
, so from the architecture itself, spring3 mvc is easy to implement restful url
, while struts2 architecture is difficult to implement
because a method of struts2 action can correspond to a url
and its class attributes are shared by all methods. It is also impossible to use annotations or other methods to identify the method to which it belongs.
4:
The methods of spring3mvc are basically independent, and the request response data is exclusive. The request
data is obtained through parameters, and the processing results are returned to the framework through ModelMap
. Variables are not shared between methods.
Struts2 is messy. Although the methods are independent, all of its Action variables are shared.
This will not affect the running of the program, but it will bring trouble to us when coding and reading the program.
5:
Because Struts2 needs to target each Request Encapsulate, encapsulate the variables of the servlet life cycle such as Request and Session into a Map, which is used by each Action, and ensures thread safety. So in principle, it is more memory-intensive.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327012213&siteId=291194637