@RequestMapping(value = "content/", method = RequestMethod.GET) public String selectOneContent( @RequestParam("cntNo") int cntNo, @ModelAttribute("searchVO") SearchVO searchVO, Model model) throws Exception { model.addAttribute(boardService.selectContent(cntNo)); return "sboard/contentPage"; }
@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"; }
@RequestMapping("content/") public String selectOneContent( @RequestParam("cntNo") int cntNo, @ModelAttribute("pageVO") PageVO pageVO, Model model) throws Exception { model.addAttribute("boardVO", boardService.selectContent(cntNo)); return "sboard/contentPage"; }
@RequestMapping(value = "content/insert/", method = RequestMethod.POST) public String insertContent(MemberVO memberVO, BoardVO boardVO, RedirectAttributes rttr) throws Exception { logger.info("content/insert/ post..."); logger.info(boardVO.toString()); boardService.insertContent(memberVO, boardVO); rttr.addFlashAttribute("result", "success"); return "redirect:/sboard/contents/"; }
@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/"; }
// view one content @RequestMapping("content/{cntNo}") public String selectContent(@PathVariable int cntNo, Model model) throws Exception { model.addAttribute("boardVO", boardService.selectContent(cntNo)); return "sboard/content"; }