if (student.getStudentCurricularPlansCount() > 1) {
if (!student.hasAnyStudentCurricularPlans()) { final ActionMessages actionMessages = new ActionMessages(); actionMessages.add("error.student.curricularPlan.nonExistent", new ActionMessage("error.student.curricularPlan.nonExistent")); saveMessages(request, actionMessages); } else {
    public ActionForward prepare(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) {        final Person person = SessionUtils.getUserView(request).getPerson();        final Student student = person.getStudentByUsername();                if (student.getStudentCurricularPlansCount() > 1) {            request.setAttribute("student", student);            request.setAttribute("studentCurricularPlans", student.getStudentCurricularPlans());                        if (student.getActiveStudentCurricularPlan().getEnrolmentsExecutionYears().isEmpty()) {                final ActionMessages actionMessages = new ActionMessages();                actionMessages.add("message.no.enrolments", new ActionMessage("message.no.enrolments"));                saveMessages(request, actionMessages);            } else {                request.setAttribute("executionYears", student.getActiveStudentCurricularPlan().getEnrolmentsExecutionYears());                }        } else if (!student.hasAnyStudentCurricularPlans()) {            final ActionMessages actionMessages = new ActionMessages();            actionMessages.add("error.student.curricularPlan.nonExistent", new ActionMessage("error.student.curricularPlan.nonExistent"));            saveMessages(request, actionMessages);        }        return mapping.findForward("createDocumentRequests");    }