I have two pages for registration. On one I get the user data into a request scoped bean and on the next one I display the data gathered. On the second page there is a button to redirect the user to log in.
Here is the button action for the register.xhtml. The result of the regUser.register is reg_success, which is the name of the second page, where I display the user data.
<p>
<h:commandButton value="#{msgs.regButtonText}" action="#{regUser.register}"/>
</p>
In the reg_success.xhtml I have this code for the button:
<p>
<h:commandButton value="#{msgs.regToLogin}" action="login"/>
</p>
My login page has the name login.xhtml.
Even if I insert this navigation rule into my faces-config.xml the forward does not happen. Indeed from the register.xhtml the user is forwarded and the url does not change on the second page.
<navigation-rule>
<from-view-id>/reg_success.xhtml</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/login.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>