2011-09-26 70 views
1

在Spring 2.5中;有SimpleFormController的方法具有Spring MVC 3 SimpleFormController

@Override 
     protected Object formBackingObject(HttpServletRequest request) throws Exception { 
      //logic for command object 

} 

什麼是它在Spring MVC 3替代我想加載命令對象在JSP頁面的形式。

回答

3

使用@ModelAttribute

@ModelAttribute 
public MyFormObject createForm(HttpServletRequest request){ 

} 

如果沒有這一要求也

@ModelAttribute 
public MyFormObject createForm(){ 

} 
工作