RequestMapping value editUser html id id method RequestMethod POST Res

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
@RequestMapping(value = "/editUser.html?id={id}", method = RequestMethod.POST)
@ResponseBody
public ModelAndView saveChanges( @PathVariable("id") Long id,
@RequestParam("login") String login,
@RequestParam("name") String name,
@RequestParam("email") String email,
@RequestParam("birthDate") String birthDate,
@RequestParam("active") boolean active) throws ParseException {
User user = mockUserDao.findUserById(id);
user.setBirthDate(new SimpleDateFormat("dd-mm-yyyy", Locale.ENGLISH).parse(birthDate));
user.setEmail(email);
user.setActive(active);
user.setLogin(login);
user.setName(name);
return listUsers();
}