예제 #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";
 }
예제 #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";
  }