FreeMarker: List Iterator Test

<#assign list= ["one", "two", "three", "four", "five"]> <#assign hash = {"key", list}> <#assign hash2 = {"value", hash}>

A simple test follows:

${message}

Now iterate over a list:

<#foreach item in list>

${item}

Now iterate again:

<#list list as item>

${item_index}. ${item}

Iterate over a list in a hash:

<#list hash.key as item>

${item}

<#foreach item in hash.key>

${item}

<#foreach item in hash[ "key" ]>

${item}

<#list hash["key"] as item>

${item}

Now test the list and foreach keywords...

<#list hash2["value"].key as key>

${key}

<#foreach az in hash2.value.key>

${az}