コード例 #1
0
 // 添加员工
 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);
 }
コード例 #2
0
  // 员工录用
  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");
  }