Spring MVC: How do I get current url in Thymeleaf

Oh I got the solution for this. I missed the {#httpServletRequest.requestURI} in the documentation.

Here is the solution which is working for me:

<a th:href="@{__${#httpServletRequest.requestURI}__/store/__${store.name}__}">Click to More</a>
//Will produce: http://localhost:8080/project/web/category/mobiles/store/samsung

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)