We used struts2 when using the traditional configuration file method, and did not use the legendary 0 configuration
SPRING3 MVC can be considered already 100% 0 configured (except for configuration Springmvc-servlet.xml)
Compare the differences between STRUS2 and SPRING3 MVC
============================================
The STRUTS2 framework is class-level blocking, creating an action each time a request is made, and then invoking the setter getter method to inject the data in the request
Struts2 is actually dealing with the request through setter getter methods.
In Struts2, an Action object corresponds to a request context
Unlike Spring3 MVC, SPRING3MVC is a method-level intercept that injects the request data into the method based on annotations on the parameters.
In Spring3mvc, a method corresponds to a request context
All right, let's get this sorted out.
Struts2 is a class-level interception, a class that corresponds to a request context,
Springmvc is a method-level interception, a method that corresponds to a request context, and a method that corresponds to a URL
So it's easy to implement restful URLs spring3 MVC from the architecture itself.
And Struts2 's architecture is hard to implement.
Because a method of struts2 action can correspond to a URL
And its class attributes are shared by all methods, which means they cannot be identified by annotations or other means.
===================================
Spring3mvc's approach is essentially independent, and the request response data is exclusive
Request data is obtained through parameters and the processing results are returned to the framework via MODELMAP.
Do not share variables between methods
and Struts2, although the method is also independent, but all of its action variables are shared
This does not affect the program's operation, but it gives us trouble coding to read the program.
====================================
SPRING3 MVC validation is also a bright spot that supports JSR303
The request to process Ajax is more convenient just one annotation @responsebody, then directly return the response text can be
Comparison between SPRING3MVC and Struts2