I wanted to access contextPath in thymeleaf without setting org.springframework.ui.Model. I configured context path in application.properties file
If you are using Thymeleaf, you should be able to use
<a th:href="@{/XXX}">Link Name</a>
assuming that has been declared.
I think this does require using SpringTemplateEngine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With