import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @Controller public class MemoController { private MemoDao memoDao; @Autowired public MemoController(MemoDao memoDao) { this.memoDao = memoDao; } @GetMapping("/") public String memo() { return "memo"; } @PostMapping("/") public String receive(MemoForm memoForm, Model model) { int memoId = memoDao.store(memoForm.getContent()); model.addAttribute("memoId", memoId); return "received"; } @GetMapping("/{memoId}") public String view(@PathVariable int memoId, Model model) { String content = memoDao.findById(memoId); model.addAttribute("content", content); return "view"; } } .FNP$POUSPMMFSKBWB %FQFOEFODZ*OKFDUJPO ύε͔ΒΛऔಘ