private IResolution parseEditRequest(IExecutionContext context) throws DataRetrievalException { UserVO user = null; if (context.isParameterPresent("id")) { String userId = context.getParameter("id"); if (userId != null) { user = accessManager.retrieveUser(new Long(userId)); } } return parseEditRequest(user, context); }
private IResolution parseAddRequest(IExecutionContext context) throws DataRetrievalException, DataWriteException { UserVO user = new UserVO(); try { beanUtilsHelper.populateBean(user, context.getParameterMap()); user.setGroup(accessManager.retrieveGroup(Long.parseLong(context.getParameter("group_id")))); accessManager.writeUser(user); return new RedirectResolution("index.html?action=" + AvailableActionType.VIEW); } catch (ValidationException ex) { context.addValidationError(ex.getValidationResult().getValidationResultMessage()); return parseEditRequest(user, context); } }