Reset all values ​​in .vars in Freemarker

I am trying to reset all variables available for my freemarker templates. I am trying to use something like:

<#list .vars?keys as prop> ${prop} = ${.vars.get(prop)} 

</#list>

I read in the documentation that .vars does not support key functionality, but I use the above to show what I'm trying to do.

This is my first day with Freemarker, so any advice would be great.

+6
java jsp freemarker
source share
1 answer

I do not think that you can list all the variables available for the template. I know that you cannot list them in Java.

FreeMarker is very well documented . Check out some of the special variables in FreeMarker .

If this is a consolation, you can access local variables,

 <#assign someVar = 12> <#list .main?keys as var> ${var} </#list> 

which outputs

 someVar 
+4
source share

All Articles