MCPcopy Index your code
hub / github.com/castello/spring_basic / modify

Method modify

ch4/BoardController3.java:21–38  ·  view source on GitHub ↗
(BoardDto boardDto, SearchCondition sc, RedirectAttributes rattr, Model m, HttpSession session)

Source from the content-addressed store, hash-verified

19 BoardService boardService;
20
21 @PostMapping("/modify")
22 public String modify(BoardDto boardDto, SearchCondition sc, RedirectAttributes rattr, Model m, HttpSession session) {
23 String writer = (String)session.getAttribute("id");
24 boardDto.setWriter(writer);
25
26 try {
27 if (boardService.modify(boardDto)!= 1)
28 throw new Exception("Modify failed.");
29
30 rattr.addFlashAttribute("msg", "MOD_OK");
31 return "redirect:/board/list"+sc.getQueryString();
32 } catch (Exception e) {
33 e.printStackTrace();
34 m.addAttribute(boardDto);
35 m.addAttribute("msg", "MOD_ERR");
36 return "board";
37 }
38 }
39
40 @GetMapping("/write")
41 public String write(Model m) {

Callers

nothing calls this directly

Calls 3

setWriterMethod · 0.80
modifyMethod · 0.65
getQueryStringMethod · 0.45

Tested by

no test coverage detected