📄 updateaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import com.dao.data.PersonInfo;
import com.dao.entity.Student;
import com.dao.service.UPerson;
import com.struts.form.UpdateForm;
/**
* MyEclipse Struts Creation date: 01-15-2008
*
* XDoclet definition:
*
* @struts.action path="/update" name="updateForm" scope="request"
* validate="true"
*/
public class UpdateAction extends DispatchAction {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward update1(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
UpdateForm updateForm = (UpdateForm) form;// TODO Auto-generated
// method stub
List list=PersonInfo.s(updateForm.getId());
request.getSession().setAttribute("list", list);
return mapping.findForward("up");
}
public ActionForward update2(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
UpdateForm updateForm = (UpdateForm) form;// TODO Auto-generated s
UPerson up=new PersonInfo();
Student s=new Student();
s.setSid(new Integer(updateForm.getId()));
s.setSname(updateForm.getSname());
s.setSage(updateForm.getSage());
s.setSsex(updateForm.getSsex());
up.up(s);
return mapping.findForward("index");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -