PrimeFacesPhaseListener listener = new PrimeFacesPhaseListener();
PhaseEvent phaseEvent = new PhaseEvent(FacesContext.getCurrentInstance(), PhaseId.RENDER_RESPONSE, lifecycle);
requestContext.setAjaxRedirectUrl(url);
listener.beforePhase(phaseEvent); //send ajax redirect request
RequestContext.getCurrentInstance().release();
} else {
RequestContext.getCurrentInstance().release();
super.redirect(url);