package idc.board.command;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;

public class BoardListCmd implements BoardCmd{
	
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		
		BoardDAO dao = new BoardDAO();
		ArrayList<BoardDTO>list;
		
		int pageCnt = 0;
		String curPage = request.getParameter("curPage");
		
		if(curPage == null) curPage = "1";
		
		//게시글 리스트 불러오기
		list = dao.boardList(curPage);		
		request.setAttribute("boardList", list);		
		pageCnt = dao.boardPageCnt();
		request.setAttribute("pageCnt", pageCnt);		
	}

}
