FreeMarker: Variable Test

[#ftl]
[#assign list = ["one", "two", "three", "four", "five"]] [#assign hash = {"output" : "My message.", "key" : list}] [#assign hash2 = {"value" : hash}] [#assign items = {"mykey" : "key", "_test", "out"}]

A simple test follows:

${message}

Now get into variable nesting:

${hash.output}

${hash["output"]}

${hash. output}

${hash .output}

${hash .output}

${hash . output}

${hash ["output"]}

${hash [ "output" ]}

More deep nesting...

${hash2.value.output}

${hash2.value.key[0]}

${hash2["value"]["key"][0]}

Nesting inside nesting...

${hash2.value[ items.mykey ][ 1 ]}

${hash2.value[ items[ "mykey" ]][ 1 ]}

${hash2.value[ items[ "my" + items.mykey ]][ 1 ]}

${hash2.value[ items[ "my" + items["mykey"] ]][ 1 ]}

Test underscores...

${items[ "_test" ]}

${items._test}

${"God save the queen."?word_list[1]?upper_case}