I’m trying to implement a Custom Naviguation, that do the usual job and update my breadcrumb.
public class CustomNaviguationHandler extends NavigationHandlerImpl{
public void handleNavigation(FacesContext context, String fromAction, String outcome) {
//do the breadcrumb update
super.handleNavigation(context, fromAction, outcome);
}
}
But when I debug it, the method is executed 2 times once,
- The 1st time, fromAction and outcome are null
- The 2nd time, these parameters contains the right values.
The handler has been registered in the faces-config.xml
<navigation-handler>my.package.CustomNaviguationHandler</navigation-handler>
I’m not sure to understant why? Any Idea?
You should not extend the JSF impl class
NavigationHandlerImplat all. You should instead extend the JSF API classNavigationHandler.Here’s a kickoff example. Do your job in the
handleNavigation()method. If you don’t want to take responsibility on navigation, delegate to theparent.