How to display messages in Thymeleaf and Spring Boot?

后端 未结 5 1917
深忆病人
深忆病人 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:38

    The message source be relative to classpath:

    messageSource.setBasename("  classpath:i18n/messages");
    

    Here is a tutorial I referenced for thymeleaf and spring = http://www.thymeleaf.org/doc/tutorials/2.1/thymeleafspring.html

提交回复
热议问题