You can't reference classes from Velociy, so Integer.parseInt
won't work. However, since in Java any static method can be called as an instance method, and Velocity is just Java in disguise, you can call parseInt
on any integer. So you can try this trick:
#if ($myVar.length().parseInt($myVar) gt 5)
You're getting hold of an integer starting from the one variable that you're assuming you have, $myVar
.