📄 u01d3action.java
字号:
package cn.hope.front.action;
import java.sql.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.hibernate.HibernateException;
import org.apache.log4j.Logger;
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 org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
//import org.apache.struts.action.DynaActionForm;
import org.apache.struts.validator.DynaValidatorForm;
import cn.hope.front.bo.U01D3bo;
import cn.hope.front.pojo.SCity;
import cn.hope.front.pojo.SClass;
import cn.hope.front.pojo.Student;
import cn.hope.front.util.Utility;
public class U01D3action extends Action{
Logger log = Logger.getLogger(U01D3action.class.getName());
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
DynaValidatorForm dyform = (DynaValidatorForm) form;
String username = (String)dyform.get("username");
//String psw = (String)dyform.get("psw");
String psw1 = (String)dyform.get("psw1");
String findpsw = (String)dyform.get("findpsw");
String question = (String)dyform.get("question");
String passport = (String)dyform.get("passport");
String name = (String)dyform.get("name");
String zzid = (String)dyform.get("zzid");
String aandw = (String)dyform.get("aandw");
String marriage = (String)dyform.get("marriage");
///String nmd = (String)dyform.get("nmd");
String inschool = (String)dyform.get("inschool");
String gph = (String)dyform.get("gph");
String yph = (String)dyform.get("yph");
String hphome = (String)dyform.get("hphome");
String lph = (String)dyform.get("lph");
String mailbox = (String)dyform.get("mailbox");
String folk = (String)dyform.get("folk");
String stime = (String)dyform.get("stime");
if(stime==null||stime.equals("")){
stime="0000-00-00";
}
String detailed = (String)dyform.get("detailed");
String speciality = (String)dyform.get("speciality");
String kge = (String)dyform.get("kge");
String ph = (String)dyform.get("ph");
String language = (String)dyform.get("language");
String grale = (String)dyform.get("grale");
String language2 = (String)dyform.get("language2");
String grale2 = (String)dyform.get("grale2");
String bio = (String)dyform.get("bio");
String litter = (String)dyform.get("litter");
String sso = (String)dyform.get("sso");
String job = (String)dyform.get("job");
String lwd = (String)dyform.get("lwd");
String warkdo = (String)dyform.get("warkdo");
String computer = (String)dyform.get("computer");
Integer classid=(Integer)dyform.get("classid");
Integer cityid=(Integer)dyform.get("cityid");
String yer = (String)dyform.get("yer");
String mon = (String)dyform.get("mon");
String day = (String)dyform.get("day");
String nmd=yer+"-"+mon+"-"+day;
Student student=new Student();
student.setSUsername(username);
student.setFlag("0");
student.setSAandw(aandw);
student.setSBio(bio);
student.setSComputer(computer);
student.setSDetailed(detailed);
student.setSEnroltime(Utility.getCurDateTime());
student.setSFindpsw(findpsw);
student.setSFolk(folk);
student.setSGph(gph);
student.setSGrale(grale);
student.setSGrale2( grale2);
student.setSHphome(hphome);
student.setSInschool(inschool);
student.setSJob(job);
student.setSKge(kge);
student.setSLanguage(language);
student.setSLanguage2(language2);
student.setSLitter(litter);
student.setSLph(lph);
student.setSLwd(lwd);
student.setSMailbox(mailbox);
student.setSName(name);
student.setSPassport(passport);
student.setSPassword(psw1);
student.setSPh(ph);
student.setSQuestion( question);
student.setSSpeciality(speciality);
student.setSSso(sso);
SClass a=new SClass();
a.setSClassid(classid);
student.setSClass(a);
SCity s=new SCity();
s.setScId(cityid);
student.setSCity(s);
try{
student.setSStime(Date.valueOf(stime));
//student.setSWarkdo(warkdo);
student.setSWarkdo(warkdo);
student.setSYph(yph);
student.setSZzid(zzid);
student.setSNmd(Date.valueOf(nmd));
student.setSMarriage(marriage);
}
catch(Exception e){
e.toString();
log.error(e);
e.printStackTrace();
throw new HibernateException(e);
}
U01D3bo ubo=new U01D3bo();
if(ubo.U01D3insert(student)==null){
ActionMessages errors = new ActionMessages();
errors.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("U01label.deny"));
if (!errors.isEmpty()) {
saveErrors(request, errors);
}
return mapping.findForward("failed"); //登陆失败
}
return mapping.findForward("D53");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -