Based on the Tags you have specified in your question, i can say that you are using JSF 2, so you can use the ConfigurableNavigationHandler
to get what you are looking for.
Use the ConfigurableNavigationHandler#getNavigationCases()
to get a Map
of Navigation cases, you can get more informations about that method from it's Javadocs:
Return a Map<String, Set<NavigationCase>>
where the keys are
values and the values are Set where
each element in the Set is a NavigationCase that applies to that
.
This is an example for invoking that method:
FacesContext context = FacesContext.getCurrentInstance();
ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) context.getApplication().getNavigationHandler();
Map<String,Set<NavigationCase>> navigationCases = navigationHandler.getNavigationCases();
In case you already knew the name of the page you want to navigate to, you can simply use that example (assuming your page file is next.xhtml):
FacesContext context = FacesContext.getCurrentInstance();
ConfigurableNavigationHandler navigationHandler= (ConfigurableNavigationHandler) context.getApplication().getNavigationHandler();
navigationHandler.performNavigation("next");
See also: