(Integer bno, SearchCondition sc, RedirectAttributes rattr, HttpSession session)
| 79 | } |
| 80 | |
| 81 | @PostMapping("/remove") |
| 82 | public String remove(Integer bno, SearchCondition sc, RedirectAttributes rattr, HttpSession session) { |
| 83 | String writer = (String)session.getAttribute("id"); |
| 84 | String msg = "DEL_OK"; |
| 85 | |
| 86 | try { |
| 87 | if(boardService.remove(bno, writer)!=1) |
| 88 | throw new Exception("Delete failed."); |
| 89 | } catch (Exception e) { |
| 90 | e.printStackTrace(); |
| 91 | msg = "DEL_ERR"; |
| 92 | } |
| 93 | |
| 94 | rattr.addFlashAttribute("msg", msg); |
| 95 | return "redirect:/board/list"+sc.getQueryString(); |
| 96 | } |
| 97 | |
| 98 | @GetMapping("/list") |
| 99 | public String list(Model m, SearchCondition sc, HttpServletRequest request) { |
nothing calls this directly
no test coverage detected