A little ditty for you on how to create a “Welcome, User!” string in Thymeleaf and Spring, or in other terminology, a parameterized message property. We’re referring to the “Welcome, user!” shown below, from my NixMash Spring app on GitHub. Not very creative with a User name of “user,” but it’s the thought that counts.
Here’s the messages.properties string.
And the Thymeleaf HTML.
Remember, we’re passing the CurrentUser object in a ControllerAdvice method for all pages.
I told you it was a little ditty…