@RequestMapping("listagem.json") @ResponseBody public String select2() throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(serv.select()); }
@RequestMapping(value = "remove", method = RequestMethod.POST) @ResponseBody public void delete(@ModelAttribute("object") E object, BindingResult result) { serv.delete(object); }
@RequestMapping(value = "atualiza", method = RequestMethod.POST) @ResponseBody public void update(@ModelAttribute("object") E object, BindingResult result) { serv.update(object); }
@RequestMapping(value = "cadastra", method = RequestMethod.POST) @ResponseBody public void insert(@ModelAttribute("object") E object, BindingResult result) { serv.insert(object); }
@RequestMapping("remove/{id}") public ModelAndView delete(@PathVariable("id") String id) { return new ModelAndView("form_remove", "command", serv.select(id)); }
@RequestMapping("atualiza/{id}") public ModelAndView update(@PathVariable("id") String id) { return new ModelAndView("form_atualiza", "command", serv.select(id)); }