InfoSeminary seminary = null;
InfoSeminaryWithEquivalencies seminary = null;
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,            HttpServletResponse response) throws FenixActionException {        HttpSession session = this.getSession(request);        IUserView userView = (IUserView) session.getAttribute(SessionConstants.U_VIEW);        String seminaryIDString = request.getParameter("objectCode");        Integer seminaryID;        if (seminaryIDString == null)            throw new FenixActionException(mapping.findForward("invalidQueryString"));        try {            seminaryID = new Integer(seminaryIDString);        } catch (Exception ex) {            throw new FenixActionException(mapping.findForward("invalidQueryString"));        }        InfoSeminary seminary = null;        InfoStudent student = null;        List disciplines = null;        ActionForward destiny = null;        try {            Object[] argsReadSeminary = { seminaryID };            Object[] argsReadStudent = { userView.getUtilizador() };            seminary = (InfoSeminary) ServiceManagerServiceFactory.executeService(userView,                    "Seminaries.GetSeminary", argsReadSeminary);            student = (InfoStudent) ServiceManagerServiceFactory.executeService(userView,                    "ReadStudentByUsername", argsReadStudent);            Object[] ReadCurricularCoursesByUsername = { userView.getUtilizador() };            disciplines = (List) ServiceManagerServiceFactory.executeService(userView,                    "student.ReadCurricularCoursesByUsername", ReadCurricularCoursesByUsername);            List avaliableEquivalencies = new LinkedList();            for (Iterator iterator = disciplines.iterator(); iterator.hasNext();) {                InfoCurricularCourse curricularCourse = (InfoCurricularCourse) iterator.next();                for (Iterator equivalencyIterator = seminary.getEquivalencies().iterator(); equivalencyIterator                        .hasNext();) {                    InfoEquivalency equivalency = (InfoEquivalency) equivalencyIterator.next();                    if (equivalency.getCurricularCourse().getIdInternal().equals(                            curricularCourse.getIdInternal())) {                        avaliableEquivalencies.add(equivalency);                        break;                    }                }            }            seminary.setEquivalencies(avaliableEquivalencies);            Object[] argsReadCandidacies = { student.getIdInternal(), seminaryID };            List candidacies = (List) ServiceManagerServiceFactory.executeService(userView,                    "Seminaries.GetCandidaciesByStudentIDAndSeminaryID", argsReadCandidacies);            if (candidacies.size() >= seminary.getAllowedCandidaciesPerStudent().intValue()) {                ActionErrors actionErrors = new ActionErrors();                ActionError actionError = new ActionError("error.seminaries.candidaciesLimitReached",                        seminary.getAllowedCandidaciesPerStudent());                actionErrors.add("error.seminaries.candidaciesLimitReached", actionError);                saveErrors(request, actionErrors);                destiny = mapping.findForward("candidaciesLimitReached");            } else {                destiny = mapping.findForward("showCandidacyOptions");                request.setAttribute("seminary", seminary);            }        } catch (Exception e) {            throw new FenixActionException(e);        }        return destiny;    }