How to show localization messages with parameters in Spring 3 / Thymeleaf

前端 未结 3 2033
失恋的感觉
失恋的感觉 2020-12-13 02:06

I\'m using Spring 3 and Thymeleaf to make some webpages and I am lost as for how to show messages like this:

welcome.message=Hello {0}, welcome!

and then rep

3条回答
  •  醉酒成梦
    2020-12-13 02:59

    You can use

    #{welcome.message(${some.attribute})}
    

    where some.attribute would be the value to use when replacing {0}.

    You should be able to comma separate the values between the () to add more values to be used.

提交回复
热议问题