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