// 添加员工 public ActionForward saveEmployee( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { EmployeeForm employeeForm = (EmployeeForm) form; if (this.isTokenValid(request)) { this.resetToken(request); objectDao.insertObjectForm(employeeForm); } else { this.saveToken(request); request.setAttribute("result", "不能重复提交!!!"); } return queryEmployee(mapping, form, request, response); }
// 员工录用 public ActionForward addEmployee( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { EmployeeForm employeeForm = (EmployeeForm) form; if (this.isTokenValid(request)) { this.resetToken(request); objectDao.insertObjectForm(employeeForm); } else { this.saveToken(request); request.setAttribute("result", "不能重复提交!!!"); } request.setAttribute("id", request.getParameter("id")); return mapping.findForward("operationEmployee"); }