コード例 #1
0
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    int id = Integer.parseInt(request.getParameter("id"));
    request.setAttribute("patient", PatientService.getById(id));
    request.setAttribute("partialPage", "/Views/editPatientForm.jsp");
    request.setAttribute("activeNavPill", "patient");
    User user = (User) request.getSession().getAttribute("currentUser");
    request.getRequestDispatcher(UserService.getTemplatePage(user)).forward(request, response);
  }
コード例 #2
0
  protected void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    request.setCharacterEncoding("windows-1251");
    int id = Integer.parseInt(request.getParameter("id"));
    Patient updatedPatient =
        TempAttributesToObj.getPatient(request); // TODO replace with JS get object from Form
    PatientService.update(updatedPatient);
    response.sendRedirect("/patientsView");
  }