List all variables accesible to a freemarker template (ftl file)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

List all variables accesible to a freemarker template (ftl file)

Boris Hamanov
Hi,

I am trying to see all data that is available to use inside my freemarker template.

So far I was able to list:

<#list requestAttributes?keys as var>
    ${var}
</#list>

<#list requestParameters?keys as var>
    ${var}
</#list>

<#list .data_model?keys as var>
    ${var}
</#list>

But this code below does not work, I guess I am not using the proper semantics, I am very new to freemarker, any help there, please?

<#list .globals.globalVariables?keys as var>
    ${var}
</#list>

<#list sessionAttributes?keys as var>
    ${var}
</#list>
Reply | Threaded
Open this post in threaded view
|

Re: List all variables accesible to a freemarker template (ftl file)

Jacques Le Roux
Administrator
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=6553757

Jacques

Boris Hamanov wrote:

> Hi,
>
> I am trying to see all data that is available to use inside my freemarker template.
>
> So far I was able to list:
>
> <#list requestAttributes?keys as var>
>     ${var}
> </#list>
>
> <#list requestParameters?keys as var>
>     ${var}
> </#list>
>
> <#list .data_model?keys as var>
>     ${var}
> </#list>
>
> But this code below does not work, I guess I am not using the proper semantics, I am very new to freemarker, any help there,
> please?
>
> <#list .globals.globalVariables?keys as var>
>     ${var}
> </#list>
>
> <#list sessionAttributes?keys as var>
>     ${var}
> </#list>