AtomicInteger() and String Interpolation


I am trying to increment a value using AtomicInteger() and string interpolation.

However, the integer is always ‘0’ and I wondered if I was wrongly mixing Scala and EL?

Many Thanks


I don’t think you can change values like that. The easiest way is create a string before request and set it as session variable.

String interpolation is not a function, it’s a macro (see it as a sugar for an implicit StringBuilder that gets appended).
You still have to wrap everything into a function if you want something to be resolved every time. See Expression documentation.

BTW, make you AtomicInteger a val, not a var!