How to manually redirect in JSF

There are times when we need to redirect manually in JSF. For example in page load we do some event and after that redirect to some page. This is how we would do it:

FacesContext ctx = FacesContext.getCurrentInstance();
ConfigurableNavigationHandler nav = (ConfigurableNavigationHandler)
ctx .getApplication().getNavigationHandler();

//navigation should be defined in faces-config.xml
nav.performNavigation("navigation");

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post
NERV Open Source
Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.