Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

How to redirect or navigate to a different page with JSF

There are several ways of navigating from 1 page to another in JSF. There are 2 that I often use:

1.) Create a h:commandButton and tie it to an action that returns a string, which maps to a page: example return "home.xhtml".

2.) Using navigation handler:
ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) FacesContext.getCurrentInstance().getExternalContext().getApplication().getNavigationHandler();
navigationHandler.performNavigation("home");
How to redirect or navigate to a different page with JSF How to redirect or navigate to a different page with JSF Reviewed by Edward Legaspi on Thursday, March 28, 2013 Rating: 5

No comments:

Powered by Blogger.