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 prepareChoiceForCoordinator(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws Exception {        HttpSession session = request.getSession(false);        IUserView userView = (IUserView) request.getSession(false).getAttribute("UserView");                Integer degreeCurricularPlanID = new Integer(request.getParameter("degreeCurricularPlanID"));        request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID);        InfoExecutionDegree infoExecutionDegree = (InfoExecutionDegree) session                .getAttribute(SessionConstants.MASTER_DEGREE);        Object argsReadExecutionPeriods[] = {degreeCurricularPlanID};        List executionPeriods = (List) ServiceManagerServiceFactory.executeService(userView,                "ReadExecutionPeriodsByDegreeCurricularPlan", argsReadExecutionPeriods);        ComparatorChain chainComparator = new ComparatorChain();        chainComparator.addComparator(new BeanComparator("infoExecutionYear.year"));        chainComparator.addComparator(new BeanComparator("semester"));        Collections.sort(executionPeriods, chainComparator);        List executionPeriodsLabelValueList = new ArrayList();        for (int i = 0; i < executionPeriods.size(); i++) {            InfoExecutionPeriod infoExecutionPeriod = (InfoExecutionPeriod) executionPeriods.get(i);            executionPeriodsLabelValueList.add(new LabelValueBean(infoExecutionPeriod.getName() + " - "                    + infoExecutionPeriod.getInfoExecutionYear().getYear(), infoExecutionPeriod                    .getIdInternal().toString()));        }        request.setAttribute(SessionConstants.LABELLIST_EXECUTIONPERIOD, executionPeriodsLabelValueList);                /* Obtain a list of curricular years */        List labelListOfCurricularYears = ContextUtils.getLabelListOfOptionalCurricularYears();        request.setAttribute(SessionConstants.LABELLIST_CURRICULAR_YEARS, labelListOfCurricularYears);        return mapping.findForward("ReadyToSearch");    }