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 execute(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {        IUserView userView = SessionUtils.getUserView(request);        DynaActionForm teacherInformationForm = (DynaActionForm) actionForm;        Integer degreeCurricularPlanID = new Integer(request.getParameter("degreeCurricularPlanID"));        request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID);        Integer executionDegreeID = new Integer(request.getParameter("executionDegreeId"));        request.setAttribute("executionDegreeId", executionDegreeID);        //Lists all years attatched to the degree curricular plan        List executionYearList = null;        try {            Object[] args = { degreeCurricularPlanID };            executionYearList = (List) ServiceUtils.executeService(userView,                    "ReadExecutionYearsByDegreeCurricularPlanID", args);        } catch (Exception e) {            e.printStackTrace();        }        List executionYearsLabelValueList = new ArrayList();        for (int i = 0; i < executionYearList.size(); i++) {            InfoExecutionYear infoExecutionYear = (InfoExecutionYear) executionYearList.get(i);            executionYearsLabelValueList.add(new LabelValueBean(infoExecutionYear.getYear(),                    infoExecutionYear.getYear()));        }        request.setAttribute("executionYearList", executionYearsLabelValueList);        String yearString = (String) teacherInformationForm.get("yearString");        List infoSiteTeachersInformation = null;        if (yearString.equalsIgnoreCase("") || yearString == null) {            //show user option            teacherInformationForm.set("yearString", ((InfoExecutionYear) executionYearList                    .get(executionYearList.size() - 1)).getYear());        }        Object[] args = { executionDegreeID, Boolean.FALSE, yearString };        infoSiteTeachersInformation = (List) ServiceUtils.executeService(userView,                "ReadTeachersInformation", args);        request.setAttribute("infoSiteTeachersInformation", infoSiteTeachersInformation);        return mapping.findForward("show");    }