How to display messages in Thymeleaf and Spring Boot?

后端 未结 5 1856
深忆病人
深忆病人 2021-02-01 05:58

I created a Spring Boot web application that uses Thymeleaf as the template engine. I configured the MessageSource to look for messages in a subfolder:



        
5条回答
  •  北海茫月
    2021-02-01 06:31

    And add this to your application.properties file

    #messages
    spring.messages.basename=i18n/messages
    

    and store the file n the correct folder as specified above.

    you don't need messageSource bean

提交回复
热议问题