public ActionForward delete( ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { ExtraCurricularActivityType type = getDomainObject(request, "activityTypeId"); try { type.delete(); } catch (DomainException e) { addErrorMessage(request, "errors", e.getKey(), e.getArgs()); } return list(mapping, actionForm, request, response); }
public ActionForward edit( ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { ExtraCurricularActivityType type = getDomainObject(request, "activityTypeId"); if (!type.getExtraCurricularActivitySet().isEmpty()) { addErrorMessage( request, "errors", "error.extraCurricularActivityTypes.unableToEditUsedType", type.getName().getContent()); return list(mapping, actionForm, request, response); } request.setAttribute("extraCurricularActivityType", type); return mapping.findForward("edit"); }