Requirement-How to programmatically navigate to next jsf page in taskflow.
Solution-
Following code show the sample code for navigating one jsf to another using code.
FacesContext context = FacesContext.getCurrentInstance();
context.getApplication().getNavigationHandler().handleNavigation(context,null,"controlflowcase");
Package: javax.faces.application.NavigationHandler
public abstract void handleNavigation(FacesContext context, String fromAction, String outcome)
Perform navigation processing based on the state information in the specified FacesContext,plus the outcome string returned by an executed application action.
Parameters:
context – The FacesContext for the current request.
fromAction – The action binding expression that was evaluated to retrieve the specified outcome,or null if the outcome was acquired by some other means.
outcome – The logical outcome returned by a previous invoked application action (which may be null)
happy coding with techartifact . 🙂