I'm new to using Spring and Thymeleaf, and I can't figure out where to put the .properties localization files. I have this Bean:
@Bean public MessageSource messageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasenames("classpath:messages/messages", "classpath:messages/validation"); // if true, the key of the message will be displayed if the key is not // found, instead of throwing a NoSuchMessageException messageSource.setUseCodeAsDefaultMessage(false); messageSource.setDefaultEncoding("UTF-8"); //
Inside login.html:
<p th:text="#{messages.hello}">Welcome to our site!</p>
Inside messages_en.properties :
messages.hello=Apparently messages work
My project structure:

I tried to create a folder inside WEB-INF called messages, but apparently I do not understand what is correct. Any ideas?
Edit: Updated question with message related code.
source share