728x90
view.jsp์ ๊ฒ์๋ฌผ ์ญ์ ๋งํฌ ์ถ๊ฐ
<a href="/board/modify?bno=${view.bno}">๊ฒ์๋ฌผ ์์ </a>
<a href="/board/delete?bno=${view.bno}">๊ฒ์๋ฌผ ์ญ์ </a>

์ถ๊ฐ ํ์ธ

<!-- ๊ฒ์๊ธ ์ญ์ -->
<delete id="delete" parameterType="int">
DELETE FROM tbl_board
WHERE bno = #{bno}
</delete>
BoardDAO
//๊ฒ์๊ธ ์ญ์
public void delete(int bno) throws Exception;
BoardDAOImple
//๊ฒ์๊ธ ์ญ์
@Override
public void delete(int bno) throws Exception {
sqlTemplate.delete("board.delete",bno);
}
BoardService
//๊ฒ์๊ธ ์ญ์
public void delete(int bno) throws Exception;
BoardServiceImple
//๊ฒ์๊ธ ์ญ์
@Override
public void delete(int bno) throws Exception {
boardDAO.delete(bno);
}
BoardController
//๊ฒ์๊ธ ์ญ์
@GetMapping("/delete")
public String getDelete(@RequestParam("bno") int bno) throws Exception{
boardService.delete(bno);
return "redirect:/board/list";
}
ํ ์คํธํ๊ธฐ



728x90