Esempio n. 1
0
 @RequestMapping(value = "/{id}" + Urls.DELETE, method = RequestMethod.GET)
 public String delete(@PathVariable long id, Model model) {
   if (brickFacade.getBrick(id) == null) {
     throw new ResourceNotFoundException();
   }
   brickFacade.removeBrick(id);
   return "redirect:/brick";
 }
Esempio n. 2
0
  @RequestMapping(value = "/{id}" + Urls.EDIT, method = RequestMethod.GET)
  public String edit(@PathVariable long id, Model model) {
    BrickDto brickDto = brickFacade.getBrick(id);
    if (brickDto == null) {
      throw new ResourceNotFoundException();
    }

    model.addAttribute("brick", brickDto);

    return "bricks/form";
  }