Search code examples
javafreemarkervelocity

Translate Apache Velocity vm into Apache FreeMarker ftl


I'm trying to translate Velocity template file to FreeMarker template file, I'm stock on converting this rows on vm, to work on ftl.

The first one is for accessing some utils function and the second one is for using an object that I can read on FreeMarker template and the map contains a "user" attribute with this object, but cannot access it. :

#* @vtlvariable name="Utils" type="com.utils.Utils" *###
#* @vtlvariable name="user" type="com.objects.UserObject" *###

I could not find any guide for explanation how to import this class on FreeMarker.


Solution

  • These look like just comments, which tell to the IDE (presumably) that we have these variables with the given types. I don't think these will actually create those variables. That happens outside the template.