Defining page navigation involves determining which page to go to after the user click a button or a link. Navigation for the application is defined in the application configuration resource file faces-config.xml using a rule-based system. Here the faces-config.xml file defines a navigation rule that tells JSF what to do when the user clicks one of the command buttons of the page whose path is specified within <from-tree-id>.

There are two navigation cases defined within separate elements because our page contains two buttons generated with <h:command_button>. Each of them has an ID, a label, a command name:

A fragment of JSF page with form and command buttons:

 <%@ taglib prefix="f" uri="" %>
<%@ taglib prefix="h" uri="" %>


  <h:form formName="manageAccount">
      <h:command_button id="withdraw" label="Withdraw money" action="withdraw"/>
      <h:command_button id="deposit" label="Deposit money" action="deposit"/>

A navigation resource file: