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"))}