I tried all the different variations of myMap.get(key)
, myMap[key]
, etc. to get this line of code working where myMap
is a Map<Long,String>
and thing
has a property called state
:
<span th:text="${myMap.get(__${thing.state}__)}"></span>
Any syntactically valid variation I could come up with would only result in empty text.
The only thing that ultimately worked was using a Map<Integer,String>
instead. I'm still passing a long
into myMap.get()
. Thankfully my value range for the particular use case is within the range of Integer
.
How do I write this line of code to be able to use a Map<Long,String>
when I need to?