Object argsReadExecutionPeriods[] = { }; ArrayList infoExecutionPeriodList = (ArrayList) gestor.executar( userView, "ReadExecutionPeriods", argsReadExecutionPeriods); ComparatorChain chainComparator = new ComparatorChain(); chainComparator.addComparator(new BeanComparator("infoExecutionYear.year")); chainComparator.addComparator(new BeanComparator("semester")); Collections.sort(infoExecutionPeriodList, chainComparator);  Integer index = (Integer) indexForm.get("index");  if (infoExecutionPeriodList != null && index != null) { InfoExecutionPeriod infoExecutionPeriod = (InfoExecutionPeriod) infoExecutionPeriodList.get( index.intValue()); request.setAttribute( SessionConstants.EXECUTION_PERIOD, infoExecutionPeriod);
Integer executionPeriodOid = (Integer) indexForm.get("index"); if (executionPeriodOid != null) {
	public ActionForward choose(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response)		throws Exception {		HttpSession session = request.getSession(false);		DynaActionForm indexForm = (DynaActionForm) form;		IUserView userView = (IUserView) session.getAttribute(SessionConstants.U_VIEW);		GestorServicos gestor = GestorServicos.manager();		Object argsReadExecutionPeriods[] = { };		ArrayList infoExecutionPeriodList =			(ArrayList) gestor.executar(				userView,				"ReadExecutionPeriods",				argsReadExecutionPeriods);		ComparatorChain chainComparator = new ComparatorChain();		chainComparator.addComparator(new BeanComparator("infoExecutionYear.year"));		chainComparator.addComparator(new BeanComparator("semester"));		Collections.sort(infoExecutionPeriodList, chainComparator);		Integer index = (Integer) indexForm.get("index");		if (infoExecutionPeriodList != null && index != null) {			InfoExecutionPeriod infoExecutionPeriod =				(InfoExecutionPeriod) infoExecutionPeriodList.get(					index.intValue());			request.setAttribute(				SessionConstants.EXECUTION_PERIOD,				infoExecutionPeriod);			request.setAttribute(				SessionConstants.EXECUTION_PERIOD_OID,				infoExecutionPeriod.getIdInternal().toString());		}		return mapping.findForward("choose");	}