コード例 #1
0
  @Override
  public void service(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    LectureApplDao lectureApplDao = new LectureApplDao();
    DBConnectionPool dbPool = new DBConnectionPool();
    lectureApplDao.setDBConnectionPool(dbPool);

    // 강좌 번호
    String lno = request.getParameter("lno");

    List<LectureApplVo2> list = lectureApplDao.lectureAppllist2(lno);

    response.setContentType("text/html;charset=UTF-8");

    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("  <head>");
    out.println("    <title>게시판</title>");
    out.println("  </head>");
    out.println("  <body>");
    out.println("  <h1>수강 현황</h1>");
    out.println("  <table border='1'>");
    out.println(
        "  <tr> "
            + "<th>학생번호</th> <th>학생이름</th> <th>신청날짜</th> <th>신청결과</th> <th>신청취소</th>"
            + "</tr>");

    for (LectureApplVo2 lectureAppl : list) {
      out.println(
          "  <tr> <td>"
              + lectureAppl.getSno()
              + "</td> <td>"
              + lectureAppl.getName()
              + "</td> <td>"
              + lectureAppl.getAp_date()
              + "</td> <td>"
              + lectureAppl.getState()
              + "</td><td>"
              + "<a href='delete?lno="
              + lno
              + "&sno="
              + lectureAppl.getSno()
              + "' >"
              + "취소</a></td></tr>");
    }

    out.println("  </table>");
    out.println("  <p><a href='list3?lno=" + lno + "'>수강신청</a></p>");
    out.println("  <p><a href='list1'>홈으로</a></p>");
    out.println("  </body>");
    out.println("</html>");
  }
コード例 #2
0
  @Override
  public void service(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    LectureApplDao lectureApplDao = new LectureApplDao();
    DBConnectionPool dbPool = new DBConnectionPool();
    lectureApplDao.setDBConnectionPool(dbPool);

    List<LectureApplVo1> list = lectureApplDao.lectureAppllist1();

    response.setContentType("text/html;charset=UTF-8");

    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("  <head>");
    out.println("    <title>게시판</title>");
    out.println("  </head>");
    out.println("  <body>");
    out.println("  <h1>강의 목록</h1>");
    out.println("  <table border='1'>");
    out.println("  <tr> " + "<th>번호</th> <th>제목</th>" + "</tr>");

    for (LectureApplVo1 lectureAppl : list) {
      out.println(
          "  <tr> <td>"
              + lectureAppl.getLno()
              + "</td> <td><a href='list2?lno="
              + lectureAppl.getLno()
              + "'>"
              + lectureAppl.getTitle()
              + "</a></td></tr>");
    }

    out.println("  </table>");
    out.println("  </body>");
    out.println("</html>");
  }