Navigation in JSF

Posted by Jagadeesh VP | Posted in

Navigation from faces-config.xml

<navigation-rule>
<from-view-id>/blah.jsp</from-view-id>
<navigation-case>
<from-outcome>some string</from-outcome>
<to-view-id>/something.jsp</to-view-id>
</navigation-case>
</navigation-rule>

Navigation from Bean:
FacesContext ctx = FacesContext.getCurrentInstance();
ctx.getApplication().getNavigationHandler().handleNavigation(...);
ctx.responseComplete();

Hint: handleNavigation(fc, actionMethodCurrent, actionNameCurrent);
Eg :
context.getApplication().getNavigationHandler().handleNavigation(context, null, managed-bean-name);

Comments (0)

Post a Comment