Exemplo n.º 1
0
 @Override
 @RequestMapping(value = "/{id}/edit", method = GET)
 public String edit(@PathVariable("id") String id, Model model) {
   Guestbook entity = guestbookService.get(id);
   model.addAttribute(entity).addAttribute("_method", "PUT");
   return formView();
 }
Exemplo n.º 2
0
  @Override
  @RequestMapping(value = "/{id}/edit", method = PUT)
  public String edit(@PathVariable("id") String id, HttpServletRequest request) {
    try {
      Guestbook entity = guestbookService.get(id);
      bind(request, entity);

      entity.modify();
    } catch (Exception e) {
      return null;
    }
    return REDIRECT_LIST;
  }
Exemplo n.º 3
0
 @Override
 @RequestMapping(value = "/{id}/delete", method = DELETE)
 public String delete(@PathVariable("id") String id) {
   guestbookService.get(id).delete();
   return REDIRECT_LIST;
 }
Exemplo n.º 4
0
 @RequestMapping(value = "/list", method = GET)
 public String list(Page<Guestbook> page, Model model) {
   page = guestbookService.queryPage(page);
   model.addAttribute(page);
   return listView();
 }