@PreAuthorize("hasAuthority('ADMIN')") @RequestMapping(value = "/admin/marca", method = RequestMethod.GET) public String marca(@RequestParam(value = "id", required = true) long id, Model model) { System.out.println("Marca -> GET"); Marca marca = mar.findOne(id); model.addAttribute("marca", marca); return "admin@marcaEditForm"; }
@PreAuthorize("hasAuthority('ADMIN')") @RequestMapping(value = "/json/marca/{id}", method = RequestMethod.GET) public @ResponseBody Marca marcaJSON(@PathVariable long id, Model model) { return mar.findOne(id); }