Spring Boot Message Source Configuration

By default Spring Boot will source messages src/main/resources/messages.properteis. Specific translations for various languages can be given using the file messages_ch.properties, messages_es.properties etc. This location can be adjusted using spring.messages.basename property. See MessageSourceAutoConfiguration class for more.

Using message is a handy way to externalize something from your view. If you’re using JSP, you can inject this value like this:

  
  The app version is ${version}

Or in thymeleaf, it can be obtained directly using hash dialect:

  The app version is 

Leave a Reply