Ejemplo n.º 1
0
 @RequestMapping(value = "/update")
 @ResponseBody
 public String update(
     @ModelAttribute User user,
     HttpServletRequest httpServletRequest,
     HttpServletResponse httpServletResponse) {
   userService.update(user);
   String id = user.getId();
   return id;
 }
Ejemplo n.º 2
0
 @RequestMapping(value = "updateForm")
 public String update(
     @Valid User user,
     BindingResult result,
     Model uiModel,
     HttpServletRequest httpServletRequest) {
   uiModel.asMap().clear();
   userService.update(user);
   populateEditForm(uiModel, user);
   return "redirect:edit/" + encodeUrlPathSegment(user.getId().toString(), httpServletRequest);
 }