Пример #1
0
 @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/";
 }
Пример #2
0
 @RequestMapping("/delete")
 public String delete(@ModelAttribute GuestBookVo vo) {
   service.delete(vo);
   return "redirect:/guestbook/";
 }
Пример #3
0
 @RequestMapping("/")
 public String list(Model model) {
   model.addAttribute("list", service.getList());
   return "/guestbook/list";
 }