옵션 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | @RequestMapping(value="/post/{bno}", method=RequestMethod.GET)//수정페이지 public ModelAndView updateForm(@PathVariable("bno") int bno) throws Exception{ BoardVO board = boardMapper.boardView(bno); return new ModelAndView("boardUpdate","board",board); } @RequestMapping(value="/post/{bno}", method=RequestMethod.PUT) //수정기능 public ModelAndView update(@ModelAttribute("BoardVO")BoardVO board,@PathVariable("bno") int bno) throws Exception{ boardMapper.boardUpdate(board); return new ModelAndView("redirect:/board"); } @RequestMapping(value="/post/{bno}", method=RequestMethod.DELETE) //삭제기능 public ModelAndView delete(@PathVariable("bno") int bno) throws Exception{ boardMapper.boardDelete(bno); return new ModelAndView("redirect:/board"); } | cs |
1 2 3 4 5 6 7 8 | <div class="form-group"> <!--수정버튼--> <input type="button" value="수정" onclick='location.href="/board/post/${board.bno}"'> <!--삭제버튼--> <form:form action="/board/post/${board.bno}" method="DELETE"> <input type="submit" value="삭제"> </form> </div> | cs |
1 2 3 4 | <form action="/board/post/${board.bno}" method="POST"> <input type="hidden" name="_method" value="DELETE"> <input type="submit" value="삭제"> </form> | cs |