Many applications are automatically tested on each commit inside a GitLab pipeline. If your application relies on a database such as PostgreSQL, it can be tempting to use an in-memory database such as H2 for tests because it is easier to set up and destroy for each execution of your test suite. While this works for simple applications, it is no longer possible once you rely on vendor-specific SQL features (e.g., usage of column types not available in H2). In ...

This tutorial is about how to highlight the currently active page in your navigation with Thymeleaf and Spring Boot. Highlighting the active page is a known usability pattern and should help users to find their way around your web application. Consider this example: In the navigation above, the navigation item “Cronjob Monitoring” is highlighted. The menu is generated with this Thymeleaf code: <nav class="mdl-navigation"> <a th:classappend="${#request.requestURI.startsWith(navItem.getLink()) ? 'mdl-navigation__link-active':''}" th:each="navItem: ${navigation}" th:id="${navItem.getIdentifier()}" class="mdl-navigation__link" th:href="@{${navItem.getLink()}}" th:text="${navItem.getName()}"></a> </nav> By using th:each, a link ...

Bernhard Knasmüller on Software Development