Eu quero pegar o ConfigurableNavigationHandler na subida do servidor.
FacesContext facesContext = FacesContext.getCurrentInstance();
ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) facesContext.getApplication().getNavigationHandler();
O facesContext vem nulo, pois:
If your code calls FacesContext, it will not work outside a thread associated with a JSF request lifecycle. A FacesContext object is created for every request and disposed at the end of the request. The reason you can fetch it via a static call is because it is set to a ThreadLocal at the start of the request. The lifecycle of a FacesContext bears no relation to that of a ServletContext.
Crio um Set de NavigationCase e desejo adicionar essas regras de navegação as regras já existentes no ConfigurableNavigationHandler. O local onde pensei em fazer isso foi na inicialização do servidor, pois só ocorre uma vez.
Alguém tem alguma idéia de como eu posso fazer isso?
Grato.