Thymeleaf Absolute URLs

Thymeleaf provides an easy way to create URLs using link expressions @{...}.

In this article, we will use absolute URLs in Thymeleaf template.

Thymeleaf Absolute URLs

Absolute URLs allow you to create links to other servers. They start by specifying a protocol name (http:// or https://).

In this example we create an absolute URL to https://www.javaguides.net/tag/thymeleaf:

<a th:href="@{https://www.javaguides.net/tag/thymeleaf}">Thymeleaf</a>

The output will be the following:

<a href="https://www.javaguides.net/tag/thymeleaf">Thymeleaf</a>

Comments