NavigationCase navCase = event.getNavigationCase();
if (navCase == null) {
return;
}
String viewId = navCase.getToViewId(facesContext);
FacesRedirect facesRedirect = store.getAnnotationData(viewId, FacesRedirect.class);
if (facesRedirect == null || facesRedirect.value() == navCase.isRedirect()) {
return;
}
String newOutcome = viewId;
if (facesRedirect.value()) {
newOutcome = newOutcome + "?faces-redirect=true";
}
facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, event.getFromAction(), newOutcome);
}