'How to load Messages in Thymeleaf

I'm trying to generate an email with Thymeleaf. I'm using a Java EE Server (like wildfly). I'm starting with this tutorial : https://www.thymeleaf.org/doc/articles/springmail.html

Unfortunately, this part doesn't work :

<p th:text="#{greeting(${name})}">Hello, Peter Static!</p>

The engine can't find the greeting message located in the files in src/main/resources/MailMessages*.properties. Instead I'm getting :

<p>??greeting_fr_FR??</p>

In the tutorial, you can find this :

@Bean
public ResourceBundleMessageSource emailMessageSource() {
    final ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
    messageSource.setBasename("mail/MailMessages");
    return messageSource;
}

Unfortunately, the org.springframework.context.support.ResourceBundleMessageSource is not available in my case.

So how can I load these MailMessage ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source