How do I concatenate strings in EL?
I want to do something like this but it doesn't work:
${var1 == 0 ? 'hi' : 'hello ' + var2}
It throws an exception trying to cast 'hello'
to a Double
Using java string concatenation works better.
#{var1 == 0 ? 'hi' : 'hello'.concat(var2)}
The benefit here is you can also pass this into a function, for instance
#{myCode:assertFalse(myVar == "foo", "bad myVar value: ".concat(myVar).concat(", should be foo"))}