일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- https://hi-zini.tistory.com/entry/%EB%B9%84%EB%8F%99%EA%B8%B0%EC%A0%81-%EB%B0%A9%EC%8B%9D-%EC%B2%98%EB%A6%AC-%EB%B0%A9%EB%B2%95-Callback-Promise-async-await
- https://appmaster.io/ko/blog/rest-apiran-mueosimyeo-dareun-yuhyeonggwa-eoddeohge-dareungayo
- https://joshua1988.github.io/web-development/javascript/promise-for-beginners/
- https://aws.amazon.com/ko/docker/
- https://joshua1988.github.io/web-development/javascript/js-async-await/
- https://jcon.tistory.com/189
- https://sewonzzang.tistory.com/22
- https://subicura.com/2017/01/19/docker-guide-for-beginners-1.html
- https://siyoon210.tistory.com/130
- https://goodgid.github.io/HTTP-Communicate-Process/
- Today
- Total
“Connecting the dots”
VisitListAction 본문
package action;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.VisitDao;
import vo.VisitVo;
/**
* Servlet implementation class VisitListAction
*/
@WebServlet("/visit/list.do")
//해당 클래스가"/visit/list.do"URL에 매핑되도록 설정
public class VisitListAction extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
*/
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//HTTP 요청을 처리하기 위한 service 메서드를 재정의
// TODO Auto-generated method stub
List<VisitVo> list = VisitDao.getInstance().selectList();
//VisitDao 클래스의 인스턴스를 생성하고 selectList메서드를 호출하여 방문 리스트를 가져온다
request.setAttribute("list", list);
//요청 객체의 속성에 list 라는 이름으로 방문리스트를 설정, 이를통해 JSP 페이지에서 해당 속성을 사용
//Dispatcher
String forward_page = "visit_list.jsp";
//포워딩 페이지의 경로를 "visit_list.jsp 로 설정
request.getRequestDispatcher(forward_page).forward(request, response);
요청을 visit_list.jsp 페이지로 포워딩 하여 결과 출력
}
}
1.VistitDao 클래스의 인스턴스를 생성하고 방문리스트를 조회
2.조회된 방문리스트를 요청 객체의 속성에 설정
3.visit_list.jsp 페이지로 포워딩하여 결과를 출력
'study > Action' 카테고리의 다른 글
VisitInsertAction (0) | 2023.07.10 |
---|