?? editteacher.java
字號(hào):
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package struts;
import hibernate.Teacher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import dao.TeacherDAO;
/**
* MyEclipse Struts
* Creation date: 04-10-2007
*
* XDoclet definition:
* @struts.action path="/editTeacher" name="teacherForm" input="/updatetea.jsp" scope="request" validate="true"
* @struts.action-forward name="success" path="/getteacher.jsp"
*/
public class EditTeacher extends Action {
private TeacherDAO teaDao;
Teacher tea;
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
TeacherForm teacherForm = (TeacherForm) form;// TODO Auto-generated method stub
String id=(String)request.getParameter("Teacher_id");
tea=teaDao.getTeacherByID(id);
tea.setName(teacherForm.getName());
tea.setPassword(teacherForm.getPassword());
tea.setTitle(teacherForm.getTitle());
if(teaDao.updateTeacher(tea))
{
return mapping.findForward("success");
}
else
{
return mapping.getInputForward();
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -