FacesContext.getCurrentInstance().getExternalContext() .redirect(getApplicationContext() + "/sop/searchWrittenEvaluationsByDate.do?method=returnToSearchPage&amp;page=0&date=" + DateFormatUtil.format("yyyy/MM/dd", this.getBegin().getTime())     + "&" + SessionConstants.EXECUTION_PERIOD_OID + "=" + executionCourse.getExecutionPeriod().getIdInternal() );
final StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(getApplicationContext()); stringBuilder.append("/sop/searchWrittenEvaluationsByDate.do?method=returnToSearchPage&amp;page=0&date="); stringBuilder.append(DateFormatUtil.format("yyyy/MM/dd", this.getBegin().getTime())); stringBuilder.append("&"); stringBuilder.append(SessionConstants.EXECUTION_PERIOD_OID); stringBuilder.append("="); stringBuilder.append(executionCourse.getExecutionPeriod().getIdInternal()); if (selectedBegin != null && selectedBegin.length() > 0 && selectedBegin.equals("true")) { stringBuilder.append("selectedBegin="); stringBuilder.append(DateFormatUtil.format("HH:mm", this.getBegin().getTime())); } if (selectedEnd != null && selectedEnd.length() > 0 && selectedEnd.equals("true")) { stringBuilder.append("selectedEnd="); stringBuilder.append(DateFormatUtil.format("HH:mm", this.getEnd().getTime())); } FacesContext.getCurrentInstance().getExternalContext().redirect(stringBuilder.toString());
    public String editWrittenTest() throws Exception {        final List<String> executionCourseIDs = new ArrayList<String>();        executionCourseIDs.add(this.getExecutionCourseID().toString());        final List<String> curricularCourseScopeIDs = new ArrayList<String>();        final Object[] argsToReadExecutionCourse = { ExecutionCourse.class, this.getExecutionCourseID() };        ExecutionCourse executionCourse = null;        try {            executionCourse = (ExecutionCourse) ServiceUtils.executeService(null, "ReadDomainObject", argsToReadExecutionCourse);        } catch (Exception e) {            String errorMessage = e.getMessage();            this.setErrorMessage(errorMessage);            return "";        }        for (CurricularCourse curricularCourse : executionCourse.getAssociatedCurricularCourses()) {            for (CurricularCourseScope curricularCourseScope : curricularCourse.getScopes()) {                if (curricularCourseScope.getCurricularSemester().getSemester().equals(                        executionCourse.getExecutionPeriod().getSemester())) {                    curricularCourseScopeIDs.add(curricularCourseScope.getIdInternal().toString());                }            }        }        final Season season = (getSeason() != null) ? new Season(getSeason()) : null;        final Object[] args = { this.getExecutionCourseID(), this.getBegin().getTime(), this.getBegin().getTime(), this.getEnd().getTime(), executionCourseIDs,                curricularCourseScopeIDs, null, this.evaluationID, season, this.getDescription() };        try {            ServiceUtils.executeService(getUserView(), "EditWrittenEvaluation", args);        } catch (Exception e) {            String errorMessage = e.getMessage();            if (e instanceof NotAuthorizedFilterException) {                errorMessage = "message.error.notAuthorized";            }            this.setErrorMessage(errorMessage);            return "";        }        final String originPage = getOriginPage();        if (originPage != null) {                        FacesContext.getCurrentInstance().getExternalContext()                    .redirect(getApplicationContext()                            + "/sop/searchWrittenEvaluationsByDate.do?method=returnToSearchPage&amp;page=0&date="                            + DateFormatUtil.format("yyyy/MM/dd", this.getBegin().getTime())//                    + "&begin="//                    + timeFormat.format(this.getBegin().getTime())//                    + "&end="//                    + timeFormat.format(this.getEnd().getTime())                            + "&" + SessionConstants.EXECUTION_PERIOD_OID + "="                            + executionCourse.getExecutionPeriod().getIdInternal()                    );            return originPage;        } else {            return this.getEvaluation().getClass().getSimpleName();        }    }