@RequestMapping(value = "content/delete/", method = RequestMethod.POST) public String deleteContent( @RequestParam("cntNo") int cntNo, SearchVO searchVO, RedirectAttributes rttr) throws Exception { logger.info("content/delete/" + cntNo + " post..."); boardService.deleteContent(cntNo); rttr.addAttribute("page", searchVO.getPage()); rttr.addAttribute("perPageNum", searchVO.getPerPageNum()); rttr.addAttribute("searchType", searchVO.getSearchType()); rttr.addAttribute("keyword", searchVO.getKeyword()); rttr.addFlashAttribute("result", "success"); return "redirect:/sboard/contents/"; }
@RequestMapping(value = "content/update/", method = RequestMethod.POST) public String updateContent(BoardVO boardVO, SearchVO searchVO, RedirectAttributes rttr) throws Exception { logger.info("content/update/ post..."); logger.info(searchVO.toString()); boardService.updateContent(boardVO); rttr.addAttribute("page", searchVO.getPage()); rttr.addAttribute("perPageNum", searchVO.getPerPageNum()); rttr.addAttribute("searchType", searchVO.getSearchType()); rttr.addAttribute("keyword", searchVO.getKeyword()); rttr.addFlashAttribute("result", "success"); logger.info(rttr.toString()); return "redirect:/sboard/contents/"; }
@RequestMapping("contents/") public String listPage( @ModelAttribute("searchVO") SearchVO searchVO, PageMaker pageMaker, Model model) throws Exception { logger.info(searchVO.toString()); // model.addAttribute("cntList", boardService.listPaginate(searchVO)); model.addAttribute("cntList", boardService.listSearch(searchVO)); pageMaker.setPageVO(searchVO); // pageMaker.setTotalCount(boardService.countPaging(searchVO)); pageMaker.setTotalCount(boardService.listSearchCount(searchVO)); model.addAttribute("pageMaker", pageMaker); return "sboard/contents"; }