long userId=Long.parseLong(request.getParameter("userId"));
String password=request.getParameter("password");
String role=request.getParameter("role");
if(password.length()<6||role.length()==0)
throw new UnableToRegisterException();
User user= new User();
user= userDAO.selectById(userId);
String cryptPassword = DigestUtils.sha256Hex(password +passwordHashPadding);
user.setPassword(cryptPassword);
user.setRole(role);
userDAO.updateUser(user);
return new ModelAndView("redirect:addUserPage.htm");
}
catch (UnableToRegisterException e) {
long userId=Long.parseLong(request.getParameter("userId"));