Tuesday, May 31, 2011

JSF: Navigating between JSF pages programmatically


public class NavigationHandler {
  public void navigate(String navigateTo){
     FacesContext fctx = FacesContext.getCurrentInstance();
     Application application = fctx.getApplication();
     NavigationHandler navHandler = application.getNavigationHandler();
     navHandler.handleNavigation(fctx,null, "name of navigation case");
  }
}