According to API MultiActionControlller
Consider the direct use of ServletRequestDataBinder in your controller method, INSTEAD OF relying on the declared argument of the command. This allows full control over the entire setup and use of the binder, INCLUDING VALIDATOR INVALIDATION AND THE FOLLOWING ASSESSMENT of binding / verification errors.
,
public class AddMultiActionController extends MultiActionController {
public AddMultiActionController() {
setValidators(new Validator [] {new CommandValidator(), new AnotherCommandValidator()});
}
public ModelAndView addCommand(HttpServletRequest request, HttpServletResponse response) throws Exception {
Command command = new Command();
ServletRequestDataBinder binder = createBinder(request, command);
binder.registerCustomEditor(...);
binder.bind(command);
return (!(binder.getErrors().hasErrors())) ? new ModelAndView("success") : new ModelAndView("failure");
}
public ModelAndView addAnotherCommand(HttpServletRequest request, HttpServletResponse response) throws Exception {
AnotherCommand anotherCommand = new AnotherCommand();
...
}
}
,