title: Append class dynamically on varying URI
body: <p>I have a context path <code>/userlist</code> and using server side pagination which results in URI like this: <code>http://localhost:8080/userlist/?pageSize=10&amp;page=2</code>.
  I am trying to append class to this tag using Thymeleaf dynamically.</p>
  <pre><code>&lt;li class=&quot;nav-item&quot;&gt;
      &lt;a class=&quot;nav-link&quot; th:with=&quot;urls=${new String[]{'/userlist','/userlist/*'}}&quot;
          th:classappend=&quot;${#arrays.contains(urls, #httpServletRequest.getRequestURI()) ? 'active' : ''}&quot; href=&quot;/userlist&quot;
          th:href=&quot;@{/userlist}&quot;&gt;
          &lt;span class=&quot;nav-icon&quot;&gt;
              &lt;i class=&quot;fas fa-users&quot;&gt;&lt;/i&gt;
          &lt;/span&gt;
          &lt;span class=&quot;nav-link-text&quot;&gt; Manage Users&lt;/span&gt;
      &lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  <p>Above works perfectly fine for <code>userlist</code> only. But not for <code>http://localhost:8080/userlist/?pageSize=10&amp;page=2</code>.</p>
  <p><strong>Question:</strong> What I am missing here?</p>