title: how to navigate to a lot of pages in jsf
body: <p>I have this problem: I have about 5 pages (could be more...) and a login page and you can always navigate to any page you want from any page you are (except login). So I did a <em>template</em>. I have a </p>
  
  <pre><code>&lt;p:layoutUnit position="north"&gt;
  </code></pre>
  
  <p>in north and another one in the south and other in the west <strong>in all the pages (except login)</strong>. The west layoutunit has a <strong>menu</strong> with page1, page2 ... pageN, the north and south have always the same. So what I did is to use a </p>
  
  <pre><code>&lt;ui:include src="norte.xhtml" /&gt;
  </code></pre>
  
  <p>in the north layoutunit and did the same with the south and west layoutunit. <strong>But the problem is that i can navigate from any page to any page</strong> so how can i manage this navigation situation? Do i have to create <strong>navigation rules</strong> for all the possible navigation situations?</p>
  
  <p>Please help me. I want to make this dynamic. I am using JavaEE 7, JSF 2.2 with PrimeFaces 4.0 and Netbeans. <strong>I want to do this in the most correct way possible.</strong></p>
  
  <p>Do i have to use <strong>forward</strong> or <strong>redirect</strong> and how do I do it?</p>
  
  <p>This is the menu code:</p>
  
  <pre><code>&lt;h:body&gt;
          &lt;ui:composition&gt;
              &lt;p:menu&gt;
                  &lt;p:menuitem value="Inicio" action="page1" /&gt;
                  &lt;p:menuitem value="Altas / Entradas" action="page2" /&gt;
                  &lt;p:menuitem value="Modificar Refacciones" action="page3" /&gt;
                  &lt;p:menuitem value="Consultar" action="page4" /&gt;
              &lt;/p:menu&gt;
          &lt;/ui:composition&gt;
      &lt;/h:body&gt;
  </code></pre>
  
  <ul>
  <li>Thanks for Your help <strong>:)</strong></li>
  </ul>
  
  <hr>