?? changeaction.java
字號:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package xing.five.struts.action;
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 xing.five.beans.PeopleInf;
import xing.five.daos.PeopleDao;
import xing.five.struts.form.ChangeForm;
/**
* MyEclipse Struts
* Creation date: 01-18-2008
*
* XDoclet definition:
* @struts.action path="/change" name="changeForm" input="/change.jsp" scope="request" validate="true"
*/
public class ChangeAction extends Action {
/*
* 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) {
ChangeForm changeForm = (ChangeForm) form;// TODO Auto-generated method stub
String name=changeForm.getName();
String password=changeForm.getPassword();
String password1=changeForm.getPassword1();
//String password2=changeForm.getPassword2();
PeopleInf p=new PeopleInf();
p.setName(name);
p.setPassword(password);
Boolean b = new Boolean(false);
PeopleDao dao=new PeopleDao();
b=dao.check(p);
if(b==true)
{
Integer id=new Integer(dao.getpeopleid(p));
System.out.print(id);
//p.setPassword(password1);
dao.update(password1,id);
return mapping.findForward("ok");
}
else
return mapping.findForward("fail");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -