Back Ground

게시판 만들기 - BoardUpdateFormAction 본문

JSP/게시판 만들기

게시판 만들기 - BoardUpdateFormAction

Back 2016. 6. 22. 19:43
package controller.action;
 
import java.io.IOException;
 
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import action.Action;
import pdh.DAO.BoardDAO;
import pdh.DAO.BoardVO;
 
 
//게시글 수정 화면으로 이동하게 하는 액션 클래스
public class BoardUpdateFormAction implements Action{
 
    @Override
    public void execute(HttpServletRequest request, HttpServletResponse responsethrows ServletException, IOException {
        String url = "view/boardUpdate.jsp";
        String num = request.getParameter("num");
        BoardDAO bDao = BoardDAO.getInstance();
        bDao.updateReadCount(num);
        BoardVO bVo = bDao.selectOnBoardByNum(num); 
                //select * from boardtest1 where num = ? 글 번호로 상세 내용보기
        
        request.setAttribute("board"bVo);
        
        RequestDispatcher dispatcher = request.getRequestDispatcher(url);
        dispatcher.forward(requestresponse);
    }
 
}


Comments