Use JavaScript within Velocity (if you must)
Since version 1.6 (i.e. a long time ago) Java, and therefore Velocity, has had a built-in JavaScript engine. The JS engine has always been reliable (though admittedly not high-performance) and if you're better at JS than Velocity... →