📄 saveaddexamineeaction.java
字号:
package org.mmxbb.exam.business.examinee;
import java.sql.SQLException;
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 org.mmxbb.exam.bean.Examinee;
import org.mmxbb.exam.dao.ExamineeDAO;
public class SaveAddExamineeAction
extends Action {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
ExamineeActionForm form = (ExamineeActionForm) actionForm;
Examinee examinee = null;
ExamineeDAO examineeDAO = null;
examinee = new Examinee();
examineeDAO = new ExamineeDAO();
examinee.setExaminee_id(form.getExaminee_id());
examinee.setPassword(form.getPassword());
examinee.setName(form.getName());
examinee.setSex(form.getSex());
examinee.setAge(form.getAge());
examinee.setOrganization_id(form.getOrganization_id());
examinee.setPost_index(form.getPost_index());
examinee.setState(form.getState());
examinee.setOperation(form.getOperation());
examinee.setEducation_index(form.getEducation_index());
examinee.setAddress(form.getAddress());
examinee.setPhone(form.getPhone());
examinee.setEmail(form.getEmail());
examinee.setRemark(form.getRemark());
try {
examineeDAO.addExaminee(examinee);
} catch (SQLException ex1) {
ex1.printStackTrace();
return actionMapping.getInputForward();
}
form.reset();
return actionMapping.findForward("success");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -