how to use messages with freemarker in spring mvc?

前端 未结 3 1333
攒了一身酷
攒了一身酷 2020-12-14 18:13

In a .jsp I would use:


to display a message from my messages.properties file.

How would

3条回答
  •  囚心锁ツ
    2020-12-14 18:48

    Import Spring Macro

    <#import "/spring.ftl" as spring/>
    

    Then

    <@spring.message "yourMessageKeyGoesHere"/>
    

    But you need to register ResourceBundleMessageSource

    
        
    
    

    Keep in mind MessageSource must be called messageSource

提交回复
热议问题