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 + "=" + getExecutionPeriodID() );
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())); if (getSelectedBegin() != null && getSelectedBegin().length() > 0 && getSelectedBegin().equals("true")) { stringBuilder.append("&selectedBegin="); stringBuilder.append(DateFormatUtil.format("HH:mm", this.getBegin().getTime())); } if (getSelectedEnd() != null && getSelectedEnd().length() > 0 && getSelectedEnd().equals("true")) { stringBuilder.append("&selectedEnd="); stringBuilder.append(DateFormatUtil.format("HH:mm", this.getEnd().getTime())); } FacesContext.getCurrentInstance().getExternalContext().redirect(stringBuilder.toString());
    public String editWrittenEvaluation() throws FenixFilterException, FenixServiceException, IOException {        if (this.getSeason() != null && this.getSeason().equals("noSelection")) {            this.setErrorMessage("label.choose.request");            return "";        }        List<String> executionCourseIDs = new ArrayList<String>(this.getAssociatedExecutionCourses()                .size());        List<String> curricularCourseScopeIDs = new ArrayList<String>();        List<String> roomsIDs = new ArrayList<String>();        if (!prepareArguments(executionCourseIDs, curricularCourseScopeIDs, roomsIDs)) {            return "";        }        final Season season = (getSeason() != null) ? new Season(getSeason()) : null;        final Object[] args = { null, this.getBegin().getTime(), this.getBegin().getTime(),                this.getEnd().getTime(), executionCourseIDs, curricularCourseScopeIDs, roomsIDs,                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 && originPage.length() > 0) {            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 + "="                            + getExecutionPeriodID()                    );            return originPage;        } else {            return WrittenTest.class.getSimpleName();            //return this.getEvaluation().getClass().getSimpleName();        }    }