InfoExecutionPeriod infoExecutionPeriod = setExecutionContext(request);   ArrayList semestres = new ArrayList(); semestres.add(new LabelValueBean("escolher", "")); semestres.add(new LabelValueBean("1 ", "1")); semestres.add(new LabelValueBean("2 ", "2")); session.setAttribute("semestres", semestres);
IUserView userView = SessionUtils.getUserView(request);
	public ActionForward prepare(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response)		throws Exception {			HttpSession session = request.getSession(false);			if (session != null) {				String inputPage = request.getParameter(SessionConstants.INPUT_PAGE);				String nextPage = request.getParameter(SessionConstants.NEXT_PAGE);				if (inputPage != null)					session.setAttribute(SessionConstants.INPUT_PAGE, inputPage);				if (nextPage != null)					session.setAttribute(SessionConstants.NEXT_PAGE, nextPage);								IUserView userView = SessionUtils.getUserView(request);				InfoExecutionPeriod infoExecutionPeriod =					setExecutionContext(request);				//TODO: this semester and  curricular year list needs to be refactored in order to incorporate masters				/* Criar o bean de semestres */				ArrayList semestres = new ArrayList();				semestres.add(new LabelValueBean("escolher", ""));				semestres.add(new LabelValueBean("1 ", "1"));				semestres.add(new LabelValueBean("2 ", "2"));				session.setAttribute("semestres", semestres);				/* Criar o bean de anos curricutares */				ArrayList anosCurriculares = new ArrayList();				anosCurriculares.add(new LabelValueBean("escolher", ""));				anosCurriculares.add(new LabelValueBean("1 ", "1"));				anosCurriculares.add(new LabelValueBean("2 ", "2"));				anosCurriculares.add(new LabelValueBean("3 ", "3"));				anosCurriculares.add(new LabelValueBean("4 ", "4"));				anosCurriculares.add(new LabelValueBean("5 ", "5"));				session.setAttribute(SessionConstants.CURRICULAR_YEAR_LIST_KEY, anosCurriculares);				/* Cria o form bean com as licenciaturas em execucao.*/				Object argsLerLicenciaturas[] =					{ infoExecutionPeriod.getInfoExecutionYear()};				List executionDegreeList =					(List) ServiceUtils.executeService(						userView,						"ReadExecutionDegreesByExecutionYear",						argsLerLicenciaturas);				ArrayList licenciaturas = new ArrayList();				licenciaturas.add(new LabelValueBean("escolher", ""));				Collections.sort(executionDegreeList, new ComparatorByNameForInfoExecutionDegree());								Iterator iterator = executionDegreeList.iterator();				int index = 0;				while (iterator.hasNext()) {					InfoExecutionDegree infoExecutionDegree =						(InfoExecutionDegree) iterator.next();					String name =						infoExecutionDegree							.getInfoDegreeCurricularPlan()							.getInfoDegree()							.getNome();					name						+= duplicateInfoDegree(							executionDegreeList,							infoExecutionDegree)						? "-"							+ infoExecutionDegree								.getInfoDegreeCurricularPlan()								.getName()						: "";					licenciaturas.add(						new LabelValueBean(name, String.valueOf(index++)));				}				session.setAttribute(					SessionConstants.INFO_EXECUTION_DEGREE_LIST_KEY,					executionDegreeList);				request.setAttribute(SessionConstants.DEGREES, licenciaturas);				if (inputPage != null)					return mapping.findForward(inputPage);				else					// TODO : throw a proper exception					throw new Exception("SomeOne is messing around with the links");			} else				throw new Exception();			// nao ocorre... pedido passa pelo filtro Autorizacao	}