@RequestMapping("/add") public String add(@ModelAttribute GuestBookVo vo) { if (vo.getMessage().trim().length() == 0 || vo.getName().trim().length() == 0 || vo.getPassword().trim().length() == 0 || vo.getMessage().contains("script") || vo.getName().contains("script")) return "redirect:/guestbook/?result=fail"; service.add(vo); return "redirect:/guestbook/"; }
@RequestMapping("/delete") public String delete(@ModelAttribute GuestBookVo vo) { service.delete(vo); return "redirect:/guestbook/"; }
@RequestMapping("/") public String list(Model model) { model.addAttribute("list", service.getList()); return "/guestbook/list"; }