询问一个关于SPRING SIMPLEFORM 的方法间运行流程问题(,也可以一起讨论)
public class FunctionLimitCtrl extends SimpleFormController{public FunctionLimitCtrl() {this.setCommandName("functionLimit");this.setCommandClass(FunctionLimit.class);this.setSessionForm(true);this.setValidateOnBinding(false);System.out.println("open..........."); //为啥构造里这个SYS打不出来?}//SOME SET注入 //关键问题在这里,ONSUBMIT方法死活就是不运行,当然里面的任何SYS也打不出消息protected ModelAndView onSubmit(Object command, BindException err,HttpServletRequest request,HttpServletResponse response) throws Exception {System.out.println("onsubmit"); ....DO SOME THINGreturn new ModelAndView(this.getSuccessView());} //奇怪的是这个processFormSubmission方法却和以往的ONSUBMIT方法一样正常运行(VOID的DOSUBMIT也可以运行)就是ONSUBMIT不行,如果删除了这个方法,并且只留下ONSUBMIT方法,ONSUBMIT还是不运行,但是却在SUBMIT后自动跳到SUCCESSVIEWprotected ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException err) throws Exception {System.out.println("processFormSubmission...");//DO SOME THING return new ModelAndView();} //在网上搜到一个说是类型绑定BUG会影响ONSUBMIT运行,但是照他的方法改了后还是没有效果/*protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {binder.registerCustomEditor(Integer.class,"id",new IntegerEditor());binder.registerCustomEditor(Integer.class,"authorityId",new IntegerEditor());}*/@SuppressWarnings("unchecked")protected Map referenceData(HttpServletRequest arg0, Object arg1, Errors arg2) throws Exception {Map pagemap=new HashMap();//PUT SOME THING IN MAPreturn pagemap;}protected Object formBackingObject(HttpServletRequest request) throws Exception {//SOME THING FOR NEW FL return fl;}}<bean id="EditFunctionLimit" value="admin/authority/FunctionLimitForm"/><property name="successView" value="redirect:/admin/auth/funl.shtml"/><!-- admin/authority/FunctionLimitList"/> --><property name="functionLimitM" ref="functionLimitM"/><property name="authorityM" ref="authorityM"/></bean>