I have a final Submit button in my Application looks like :
public String finalSubmitNavigate(){
// LOGIC HERE!
FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(FacesContext.getCurrentInstance(), null, "success");
return "success";
}
I have also set navigation case in my faces-config.xml file:
<navigation-rule>
<from-view-id>/Application.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/Page1.jsp</to-view-id>
</navigation-case>
</navigation-rule>
the function finalSubmitNavigate()
is set as the action of a button in my application.
the logic is writing data to database and is working fine. However, the navigation doesn't occur. I have tried without the FacesContext....getNavigationHandler() also and it didn't work. I have also tried Page1.iface
instead of Page1.jsp
in the faces-config.xml.
Do you know what's wrong? or what am I missing?
Thanks,