if (request.getParameter("editSubmit") == null) {
Mapping.begin();
// initialisation du formulaire
User u = User.getInstance(id);
UserForm f = (UserForm) form;
f.setLogin(u.getLogin());
f.setPassword(u.getPassword());
f.setGroups(u.getGroupsIds());
request.setAttribute("metaData", ((UserImpl) u).getMetaData());
Mapping.commit();
return new ActionForward( mapping.getInput() );
}
// effectu les modifications
Mapping.begin();
UserForm f = (UserForm) form;
User u = User.getInstance(id);
u.setPassword(f.getPassword());
String[] g = f.getGroups();
u.resetGroups();
if (g != null) {
for (int i = 0; i < g.length; i++) {
u.addGroup(Group.getInstance(g[i]));
}