title: Displaying active navigation based on contextual data
body: <p>I have the following separated fragment in a Thymeleaf template.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ul class="nav nav-tabs"&gt;
      &lt;li role="presentation"&gt;&lt;a href="/"&gt;Freight Invoices&lt;/a&gt;&lt;/li&gt;
      &lt;li role="presentation"&gt;&lt;a href="/processed"&gt;Processed Invoices&lt;/a&gt;&lt;/li&gt;
      &lt;li role="presentation"&gt;&lt;a href="/postingrules"&gt;Posting Rules&lt;/a&gt;&lt;/li&gt;
      &lt;li role="presentation" class="active"&gt;&lt;a href="/settings"&gt;Settings&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to add an "active" class to active navigation element — but it seems hard to accomplish in Thymyleaf. Any suggestions?</p>