Friday 10 June 2011

navigate to other web pabe from a JSF backing bean

Assume we are in a page and we want to go to page foo.xhtml:

FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(
   FacesContext.getCurrentInstance(), null, "foo.xhtml?faces-redirect=true");


method signagure
public void handleNavigation(FacesContext fc, String actionMethod, String actionName) {}

References
http://download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/api/javax/faces/application/NavigationHandler.html#handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)

No comments:

Post a Comment