perwendel / spark-template-engines

Repository for different Template engine implementations.
Apache License 2.0
134 stars 101 forks source link

Update Velocity to 2.0 #68

Open valtterip opened 6 years ago

valtterip commented 6 years ago

It does indeed look like the Velocity team has released their septennial update https://velocity.apache.org/news.html

The 2.0 should probably be taken into this project as well?

Thanks!

toyg commented 5 years ago

This is actually a security issue now, because 1.7 is vulnerable due to the dependency on commons-collections 3.2.1.

It looks like there is a slight change required in VelocityTemplateEngine.java to make it work with Velocity 2. Because all context keys are String now, the line:

Map<?, ?> modelMap = (Map<?, ?>) model;

has to become something like:

Map<String, Object> modelMap = (Map<String, Object>) model;

I'll send a pull request as soon as I get the time.