0

The documentation says that you can use parameters in your strings like so:

home.welcome=¡Bienvenido a nuestra tienda de comestibles, {0}!

<p th:utext="#{home.welcome(${user.name})}">
  Welcome to our grocery store, Sebastian Pepper!
</p>

And indeed, that is working for me.

However, it also says that "several parameters can be specified, separated by commas."

However, I cannot figure out the syntax for multiple parameters.

My source string is something like

home.welcome=Welcome to {0} store, {1}!

And I have tried the following expressions

1. #{home.welcome((${store.name}),(${user.name}))}
2. #{home.welcome(${store.name}, ${user.name})}
3. #{home.welcome(${store.name, user.name})}
4. #{home.welcome(${store.name}),(${user.name})}

Which all give TemplateProcessingException: Could not parse as expression, except #4 which gives ??home.welcome(${store.name}),_en??

What is the correct syntax of the expression for loading two parameters into a template string?

I found this answer, but it doesn't work. It suggests I do #2 above

https://stackoverflow.com/a/27501557/2153273

lbenedetto
  • 2,022
  • 1
  • 21
  • 39

0 Answers0