MultiActionController is one of the types of Controllers in Spring. It extends AbstractController. (Somewhat similar to DispatchAction in Struts) Why MultiActionController?: It aggregates multiple request handling methods into single controller, so related functionality can be kept together easily.
Spring in the use of the controller, and SimpleFormController AbstractController application is the highest. AbstractController Controller is the most fundamental, and can give users maximum flexibility.
SimpleFormController the typical form for editing and submission. In a growing need, delete, change, the demand for search, add and modify expansion SimpleFormController completed, delete, and for the expansion of AbstractController completed.
Using Spring MultiActionController class you can group related actions into a single controller class. The handler method for each action should be in the following form.
public (ModelAndView | Map | String | void) actionName(HttpServletRequest, HttpServletResponse [,HttpSession] [,CommandObject]);
To group multiple actions your controller class should extend MultiActionController class. Here the UserController class extends the MultiActionController class and contains the add() and the remove() method
However, as the above as a complete object by business, delete, change, examination, and all belong to a class of related businesses. Related to the operation of a distribution to the different classes to complete, breaching the "high cohesion" design principles. This four operational need to complete four categories, resulting in too many types of documents, difficult to maintain and configure.
So Struts from the Spring DispatchAction provides a similar function MultiActionController. Can be achieved at the request of different paths corresponding MultiActionController in different ways, and this can be related to the operation of all the relevant categories in a complete method. This makes this type of "high cohesion", but also conducive to the maintenance of systems, but also to avoid the duplication of code. Increase and revise the operation of data validation logic is very similar, after MultiActionController can use and modify operations to increase sharing of data validation logic code.