Ejemplo n.º 1
0
 @RequestMapping(value = "/group-form", method = RequestMethod.POST)
 public void add(
     @ModelAttribute Group group, HttpServletResponse response, @RequestParam String image)
     throws IOException {
   groupService.save(group, image);
   response.sendRedirect("/index.html");
 }
Ejemplo n.º 2
0
 @RequestMapping(value = "/group/edit", method = RequestMethod.POST)
 public void edit(
     @RequestParam int id,
     @ModelAttribute Group group,
     HttpServletResponse response,
     @RequestParam String image)
     throws IOException {
   group.setId(id);
   groupService.edit(group, image);
   response.sendRedirect("/index.html");
 }
Ejemplo n.º 3
0
 @RequestMapping("/group/edit")
 public String showEdit(@RequestParam int id, Model model) {
   model.addAttribute("group", groupService.findOne(id));
   model.addAttribute("images", constructImages());
   return "admin-group-form";
 }
Ejemplo n.º 4
0
 @RequestMapping(value = "/group/delete", method = RequestMethod.POST)
 public void remove(@RequestParam int id, HttpServletResponse response) throws IOException {
   groupService.delete(id);
   response.sendRedirect("/index.html");
 }