Object args[] = { userView, infoEnrolmentTemp.getIdInternal() };
Object args[] = { userView, studentNumber, DegreeType.MASTER_DEGREE, infoEnrolmentTemp.getIdInternal() };
    public ActionForward chooseStudentMarks(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws Exception {        ActionErrors actionErrors = new ActionErrors();        String curricularCourseId = MarksManagementDispatchAction.getFromRequest("courseId", request);        MarksManagementDispatchAction.getFromRequest("objectCode", request);        MarksManagementDispatchAction.getFromRequest("degreeId", request);        Integer studentNumber = null;        try {            studentNumber = Integer.valueOf(MarksManagementDispatchAction.getFromRequest(                    "studentNumber", request));        } catch (NumberFormatException e) {            actionErrors.add("StudentNumberRequired", new ActionError("error.studentNumber.required"));            saveErrors(request, actionErrors);            return prepareChangeMark(mapping, form, request, response);        }        // Get mark student List        String showMarks = MarksManagementDispatchAction.getFromRequest("showMarks", request);        List infoSiteEnrolmentEvaluations = null;        IUserView userView = SessionUtils.getUserView(request);        try {            Object args[] = { Integer.valueOf(curricularCourseId), studentNumber, null };            infoSiteEnrolmentEvaluations = (List) ServiceManagerServiceFactory.executeService(userView,                    "ReadStudentMarksByCurricularCourse", args);        } catch (ExistingServiceException e) {            //invalid student number            actionErrors.add("StudentNotExist", new ActionError("error.student.notExist"));            saveErrors(request, actionErrors);            if (showMarks == null) {                return prepareChangeMark(mapping, form, request, response);            }            return mapping.findForward("chooseCurricularCourse");        } catch (FenixServiceException e) {            throw new FenixActionException(e);        }        if (infoSiteEnrolmentEvaluations.size() == 0) {            actionErrors.add("StudentNotEnroled", new ActionError(                    "error.student.Enrolment.curricularCourse.invalid", String.valueOf(studentNumber)));            saveErrors(request, actionErrors);            return prepareChangeMark(mapping, form, request, response);        }        if (((InfoSiteEnrolmentEvaluation) infoSiteEnrolmentEvaluations.get(0))                .getEnrolmentEvaluations().size() == 0) {            actionErrors.add("StudentNotEnroled", new ActionError("error.student.Mark.NotAvailable",                    String.valueOf(studentNumber)));            saveErrors(request, actionErrors);            if (showMarks != null) {                return mapping.findForward("chooseCurricularCourse");            }            return prepareChangeMark(mapping, form, request, response);        }        InfoEnrolment infoEnrolmentTemp = ((InfoEnrolmentEvaluation) ((InfoSiteEnrolmentEvaluation) infoSiteEnrolmentEvaluations                .get(0)).getEnrolmentEvaluations().get(0)).getInfoEnrolment();        InfoEnrolmentEvaluation newEnrolmentEvaluation = null;        try {            Object args[] = { userView, infoEnrolmentTemp.getIdInternal() };            newEnrolmentEvaluation = (InfoEnrolmentEvaluation) ServiceManagerServiceFactory                    .executeService(userView, "ReadInfoEnrolmentEvaluationByEvaluationOID", args);        } catch (ExistingServiceException e) {            throw new ExistingActionException(e);        }        Locale locale = new Locale("pt", "PT");        String examDay = null;        String examMonth = null;        String examYear = null;        String gradeAvailableDay = null;        String gradeAvailableMonth = null;        String gradeAvailableYear = null;        if (newEnrolmentEvaluation.getExamDate() != null) {            examDay = FormataData.getDay(DateFormat.getDateInstance(DateFormat.SHORT, locale).format(                    newEnrolmentEvaluation.getExamDate()));        } else {            examDay = "";        }        if (newEnrolmentEvaluation.getExamDate() != null) {            examMonth = FormataData.getMonth(DateFormat.getDateInstance(DateFormat.SHORT, locale)                    .format(newEnrolmentEvaluation.getExamDate()));        } else {            examMonth = "";        }        if (newEnrolmentEvaluation.getExamDate() != null) {            examYear = FormataData.getYear(DateFormat.getDateInstance(DateFormat.SHORT, locale).format(                    newEnrolmentEvaluation.getExamDate()));        } else {            examYear = "";        }        if (newEnrolmentEvaluation.getGradeAvailableDate() != null) {            gradeAvailableDay = FormataData.getDay(DateFormat.getDateInstance(DateFormat.SHORT, locale)                    .format(newEnrolmentEvaluation.getGradeAvailableDate()));        } else {            gradeAvailableDay = "";        }        if (newEnrolmentEvaluation.getGradeAvailableDate() != null) {            gradeAvailableMonth = FormataData.getMonth(DateFormat.getDateInstance(DateFormat.SHORT,                    locale).format(newEnrolmentEvaluation.getGradeAvailableDate()));        } else {            gradeAvailableMonth = "";        }        if (newEnrolmentEvaluation.getGradeAvailableDate() != null) {            gradeAvailableYear = FormataData.getYear(DateFormat                    .getDateInstance(DateFormat.SHORT, locale).format(                            newEnrolmentEvaluation.getGradeAvailableDate()));        } else {            gradeAvailableYear = "";        }        DynaActionForm studentNumberForm = (DynaActionForm) form;        studentNumberForm.set("examDateYear", examYear);        if (examMonth != "") {            int month = Integer.valueOf(examMonth).intValue() - 1;            studentNumberForm.set("examDateMonth", String.valueOf(month));        } else {            studentNumberForm.set("examDateMonth", "");        }        if (examDay != "") {            studentNumberForm.set("examDateDay", new Integer(Integer.parseInt(examDay)).toString());        } else {            studentNumberForm.set("examDateDay", "");        }        studentNumberForm.set("gradeAvailableDateYear", gradeAvailableYear);        if (gradeAvailableMonth != "") {            int month = Integer.valueOf(gradeAvailableMonth).intValue() - 1;            studentNumberForm.set("gradeAvailableDateMonth", String.valueOf(month));        } else {            studentNumberForm.set("gradeAvailableDateMonth", "");        }        if (gradeAvailableDay != "") {            studentNumberForm.set("gradeAvailableDateDay", new Integer(Integer                    .parseInt(gradeAvailableDay)).toString());        } else {            studentNumberForm.set("gradeAvailableDateDay", "");        }        studentNumberForm.set("grade", newEnrolmentEvaluation.getGrade());        studentNumberForm.set("observation", newEnrolmentEvaluation.getObservation());        studentNumberForm.set("enrolmentEvaluationType", String.valueOf(newEnrolmentEvaluation                .getEnrolmentEvaluationType().toString()));        studentNumberForm.set("studentNumber", studentNumber);        //		responsible teacher        InfoTeacher infoTeacher = null;        if (newEnrolmentEvaluation.getInfoPersonResponsibleForGrade() != null) {            try {                Object args[] = { newEnrolmentEvaluation.getInfoPersonResponsibleForGrade()                        .getUsername() };                infoTeacher = (InfoTeacher) ServiceManagerServiceFactory.executeService(userView,                        "ReadTeacherByUsername", args);            } catch (ExistingServiceException e) {                throw new ExistingActionException(e);            }            studentNumberForm.set("teacherNumber", String.valueOf(infoTeacher.getTeacherNumber()));        } else {            studentNumberForm.set("teacherNumber", "");        }        request.setAttribute(SessionConstants.ENROLMENT_EVALUATION_TYPE_LIST, Arrays.asList(EnrolmentEvaluationType.getSexLabelValues(null)));        request.setAttribute(SessionConstants.MONTH_DAYS_KEY, Data.getMonthDays());        request.setAttribute(SessionConstants.MONTH_LIST_KEY, Data.getMonths());        request.setAttribute(SessionConstants.YEARS_KEY, Data.getYears());        request.setAttribute("lastEnrolmentEavluation", newEnrolmentEvaluation);        request.setAttribute("infoSiteEnrolmentEvaluation", infoSiteEnrolmentEvaluations);        return mapping.findForward("studentMarks");    }