title: How to get current page address using thymeleaf?
body: <p>I try to mark current element in menu using bootstrap and "active" class but I don't know how to get value of the current page.
  This is my nav bar:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;nav class="navbar navbar-expand-md sticky-top navbar-ligth bg-fadded"&gt;
    &lt;a class="nav-link waves-effect waves-light" th:href="@{/}"&gt;
      &lt;img class="home-logo" alt="UTL-2" th:src="@{/static/img/site-logo.png}" /&gt;&lt;/a&gt;
    &lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&gt;
              &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
          &lt;/button&gt;
    &lt;div class="collapse navbar-collapse justify-content-center" id="navbarSupportedContent"&gt;
      &lt;ul id="myDIV" class="navbar-nav mr-auto"&gt;
        &lt;li class="nav-item" th:classappend="${module == 'login' ? 'active' : ''}"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/login}"&gt;Вход
                          &lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item" th:classappend="${module == 'plan' ? 'active' : ''}"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/plan}"&gt;График &lt;br/&gt;отгрузки&lt;/a&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item" th:classappend="${module == 'orders' ? 'active' : ''}"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/orders}"&gt;Заявки&lt;/a&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item" th:classappend="${module == 'stations' ? 'active' : ''}"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/stations}"&gt;Справочник &lt;br/&gt;станций&lt;/a&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/partner}"&gt;Справочник &lt;br/&gt;контрагентов&lt;/a&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/map}"&gt;Карта&lt;/a&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/info}"&gt;Информация&lt;/a&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item" sec:authorize="hasRole('ADMIN')"&gt;
          &lt;a class="nav-link waves-effect waves-light" th:href="@{/admin}"&gt;Панель &lt;br/&gt;администратора&lt;/a&gt;
        &lt;/li&gt;
  
      &lt;/ul&gt;
  
      &lt;div id="logged-in-info"&gt;
        &lt;span sec:authorize="isAuthenticated()"&gt;Hello, &lt;b sec:authentication="name"&gt;(Anonimous)&lt;/b&gt;&lt;/span&gt;
        &lt;!--&lt;span th:text="${#authentication.getPrincipal().getUsername()}"&gt;&lt;/span&gt;--&gt;
  
        &lt;form sec:authorize="isAuthenticated()" method="post" th:action="@{/logout}"&gt;
          &lt;input type="submit" class="btn btn-light" value="Logout" /&gt;
        &lt;/form&gt;
        &lt;form sec:authorize="isAnonymous()" method="post" th:action="@{/login}"&gt;
          &lt;input type="submit" class="btn" value="Login" /&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/nav&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And I try to use this construction to add "active" class <code>th:classappend="${module == 'login' ? 'active' : ''}"</code>, but module attribute I should put in controller class for each page. Is there some solution to get name of the current active page and put this code instead of "module" attribute?</p>
  
  <p>P.S. I allready found some solutions using javascript to mark selected element as active, but it works untill page is updated, but each link leads to another page, and element on menu is no longer "active".</p>