The wise man said that he could not accept the things of others without thinking and estimating by himself. Information can only be a reference, as to whether it is correct, but also to distinguish themselves
several advantages of SPRINGMVC with respect to Structs :
1, SPRINGMVCHigher Security,structs2The framework is class-level interception, each timeRequestRequeststructs2will create one for itAction, and then inject the data into the entitybeenin, so instructs2, aActioncorresponds to aRequestcontext. Springmvcis a method-level intercept, eachRequestcorresponds to a method and then injects the data into the corresponding entity through annotations, so theSpringmvc, a method corresponds to aRequestcontext, the granularity is smaller, so saySpringmvcMore secure
2, Springmvc Direct use of annotations, the configuration is more concise and clear,structs2 All the path configuration in the structs.xml file, Multi-person development time is more prone to conflict, configuration is relatively complex, but this is also An advantage of structs2, that is, you can find all the paths in this file.
3, Springmvc exception handling mechanism is more excellent. structs2 action method declaration is thrown when exception exception, so we no longer need execute method catch exception, only in struts.xml springmvc
4, relative to Structs2,springmvc parameter transfer is more convenient. SPRINGMVC directly uses the corresponding entity to receive form information submitted by Form, and structs2 to The corresponding entity is specified in the form, otherwise structs cannot distinguish which entity the data in the form corresponds to
The advantages of SPRINGMVC with respect to Structs