Integer degreeCurricularPlanID = new Integer(request.getParameter("degreeCurricularPlanID")); request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID);
Integer degreeCurricularPlanID = null; if(request.getParameter("degreeCurricularPlanID") != null){ degreeCurricularPlanID = new Integer(request.getParameter("degreeCurricularPlanID")); request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID); }
    public ActionForward prepareSelectCourseList(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws Exception {        HttpSession session = request.getSession();        DynaActionForm chooseCurricularCoursesForm = (DynaActionForm) form;        String executionYear = getFromRequest("executionYear", request);        Integer degreeCurricularPlanID = new Integer(request.getParameter("degreeCurricularPlanID"));        request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID);        String degree = getFromRequest("degree", request);        String candidateID = getFromRequest("candidateID", request);        InfoExecutionDegree infoExecutionDegree = (InfoExecutionDegree) session                .getAttribute(SessionConstants.MASTER_DEGREE);        if (((degree == null) || (degree.length() == 0)) && infoExecutionDegree != null) {            degree = infoExecutionDegree.getInfoDegreeCurricularPlan().getName();        }        if (((executionYear == null) || (executionYear.length() == 0)) && infoExecutionDegree != null) {            executionYear = infoExecutionDegree.getInfoExecutionYear().getYear();        }        request.setAttribute("jspTitle", getFromRequest("jspTitle", request));        request.setAttribute("executionYear", executionYear);        request.setAttribute("degree", degree);        // Get the Curricular Course List        IUserView userView = (IUserView) session.getAttribute(SessionConstants.U_VIEW);        List curricularCourseList = null;        try {            Object args[] = { degreeCurricularPlanID };            curricularCourseList = (List) ServiceManagerServiceFactory.executeService(userView,                    "ReadCurricularCoursesByDegree", args);        }        catch (NonExistingServiceException e) {            ActionErrors errors = new ActionErrors();            errors.add("nonExisting", new ActionError("message.public.notfound.curricularCourses"));            saveErrors(request, errors);            return mapping.getInputForward();        } catch (ExistingServiceException e) {            throw new ExistingActionException(e);        }        List candidateEnrolments = null;        try {            Object args[] = { new Integer(candidateID) };            candidateEnrolments = (List) ServiceManagerServiceFactory.executeService(userView,                    "ReadCandidateEnrolmentsByCandidateID", args);        } catch (NotAuthorizedException e) {            throw new NotAuthorizedActionException(e);        } catch (FenixServiceException e) {            throw new FenixActionException(e);        }        initForm(request, chooseCurricularCoursesForm, candidateID, curricularCourseList,                candidateEnrolments);        //    orderCourseList(curricularCourseList);        orderCandidateEnrolments(candidateEnrolments);        request.setAttribute("curricularCourses", curricularCourseList);        InfoMasterDegreeCandidate infoMasterDegreeCandidate = null;        try {            Object args[] = { new Integer(candidateID) };            infoMasterDegreeCandidate = (InfoMasterDegreeCandidate) ServiceManagerServiceFactory                    .executeService(userView, "GetCandidatesByID", args);        } catch (FenixServiceException e) {            throw new FenixActionException(e);        }        request.setAttribute("candidate", infoMasterDegreeCandidate);        if (infoExecutionDegree == null) {            try {                Object args[] = { new Integer(candidateID) };                infoExecutionDegree = (InfoExecutionDegree) ServiceManagerServiceFactory.executeService(                        userView, "ReadExecutionDegreeByCandidateID", args);            } catch (NotAuthorizedException e) {                throw new NotAuthorizedActionException(e);            } catch (FenixServiceException e) {                throw new FenixActionException(e);            }        }        request.setAttribute("infoExecutionDegree", infoExecutionDegree);        //        //		generateToken(request);        //		saveToken(request);        return mapping.findForward("PrepareSuccess");    }