title: Highlighting current page as active link in included navigation menu
body: <p>I have a static menu in the sidebar which I include in every JSF page. The menu looks like so:</p>
  
  <pre><code>  &lt;li class="nav-header"&gt;Item 1&lt;/li&gt;
    &lt;li class="active"&gt;&lt;a href="index.xhtml"&gt;Item 2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="new_workload.xhtml"&gt;Item 3&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="import_workload.xhtml"&gt;Item 4&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Adding a <code>class="active"</code> to the <code>&lt;li&gt;</code> highlights the menu. How do I go about making sure selected item is highlighted dynamically in JSF2?</p>
  
  <p>I know PrimeFaces and RichFaces have ready made components for this, but I want to try a pure JSF 2 solution first. A pure client side JavaScript solution is also acceptable.</p>