Recover a property of a file . properties directly with Thymeleaf

Asked

Viewed 94 times

0

In a file . properties I have a property with the system version.

Is there any way Thymeleaf can recover this property directly?

I want to use in the footer that is a fragment used in all pages.

1 answer

1


To whom it may concern. Spring boot automatically configures Thymeleaf. With this the messages.properties files are automatically identified (as long as they are in the default directory. Same as the application.properties file). Simply include #{name.key} in the hmtl file. Example:

<p class="navbar-text hidden-xs" th:text="|Versão - #{home.versao}|"></p>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.