在spting的SimpleFormController类中有这样一段
当运行到ModelAndView mv = onSubmit(command);(下面代码底3行)为什么不执行SimpleFormController类中的onSubmit(command)方法,而是执行了继承SimpleFormController的类中的onSubmit(command)方法.这是为什么,百思不解.SimpleFormController部分代码如下:
protected ModelAndView onSubmit(Object command, BindException errors) throws Exception {
ModelAndView mv = onSubmit(command);
if (mv != null) {
// simplest onSubmit version implemented   in custom subclass
return mv;
}
else {
// default behavior: render success view
if (getSuccessView() == null) {
throw new ServletException("successView isn't set");
}
return new ModelAndView(getSuccessView(), errors.getModel());
}
} protected ModelAndView onSubmit(Object command) throws Exception {
doSubmitAction(command);
return null;
} protected void doSubmitAction(Object command) throws Exception {
}