FacesContext context = FacesContext.getCurrentInstance();
NavigationHandler handler = context.getApplication().getNavigationHandler();
if (handler instanceof ConfigurableNavigationHandler) {
ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) handler;
demo = getCurrentDemo().getId();
sample = getCurrentSample().getId();
NavigationCase navCase = navigationHandler.getNavigationCase(context, null, "/richfaces" + SEPARATOR
+ getCurrentDemo().getId() + SEPARATOR + getCurrentSample().getId());
if (navCase == null) {
navCase = new NavigationCase("/index.xhtml", null, null, null, "/richfaces/ajax/ajax.xhtml", null, false,
true);