📄 editcatfc.java
字号:
package org.ggyy.web.ctrl;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.ggyy.bo.Cat;
import org.ggyy.dao.ICatDao;
import org.ggyy.web.cmd.CatCmd;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
/**
* @spring.bean id="editCatFC"
* @spring.property name="catDao" ref="catDao"
* @spring.property name="formView" value="catForm.jsp"
* @spring.property name="sessionForm" value="true"
* @spring.property name="validator" ref="catFVLD"
*
*/
public class EditCatFC extends AbstractPetFC{
public EditCatFC (){
this.setCommandClass(Cat.class);
}
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
Cat cat = (Cat) command;
this.getCatDao().store(cat);
return new ModelAndView(new RedirectView("listCat.sf"),"parentId",cat.getParent().getId()+"");
}
protected Object formBackingObject(HttpServletRequest request)
throws Exception {
String id=(String)request.getParameter("catId");
Cat cat=(Cat) this.getCatDao().load(id);
return cat;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -