private void redirect(String recordType) throws IOException {
    if (recordType.equals("user")) {
      if (request.getParameter("type").equals("doctor"))
        response.sendRedirect("register_doctor.jsp");
      else if (request.getParameter("type").equals("patient"))
        response.sendRedirect("register_patient.jsp");
    }
  }