sform.setGroups(user.getGroupsIds());
sform.setPassword(user.getPassword());
} catch (Exception e) {
Mapping.rollback();
throw new ServletException(e);
}
// Forward to the view page
return (mapping.findForward("view"));
}
// fill data | errors
if (errors.size() > 0) {
try {
request.setAttribute(ERROR_KEY, errors);
} catch (Exception e) {
Mapping.rollback();
throw new ServletException(e);
}
// Forward to the view page
return (mapping.findForward("view"));
}
// all it's ok : update user
try {
Mapping.begin();
User user = User.getInstance(id);
user.setMetaData("name", sform.getName());
user.setMetaData("email", sform.getEmail());
user.setPassword(sform.getPassword());
Mapping.commit();
} catch (Exception e) {
Mapping.rollback();
throw new ServletException(e);
}
// Forward to the next page
return (mapping.findForward("ok"));
}