< #list var as map>
<tr>
< #list Map?keys as itemkey>//key points
< #if itemkey= "Fieldlabel" && map[' type '] = = "Text" >
<TD >${map[itemKey]}</td>
</#if >
< #if itemkey= "java_lang_string" && map[' type '] = = "Text" >
<TD >${map[itemKey]}</td>
</#if >
< #if itemkey= "Fieldlabel" && map[' type '] = = "File" >
<TD >${map[' Fieldlabel ']}</td>
</#if >
< #if itemkey= "Java_io_file" && map[' type '] = = "File" >
<TD >
< #list "${map[itemkey]}" Split (",") as x>//using the Split function, equivalent to the Split function in Java
<a href= "Flowdownservlet?filename=${x}" >${x}</a>
</#list >
</td>
</#if >
</#list >
< #if map[' type '] = = "Select" >
<TD >${map[' Fieldlabel ']}</td>
<TD >
< #list Form.fields as field>
< #if Field.fieldInput.type = = "Select" >
<select name= "props[' ${field.fieldname} ']" >
< #list Field.items as item>
<option < #if map[' java_lang_string '] = = item.value>selected</#if > value= "${item.value}" >${ Item.label}</option>
</#list >
</select>
</#if >
</#list >
</td>
</#if >
</tr>
</#list >
Data passed over the background
list<linkedhashmap<string,object>> var = submitmanager.getinstance (). GetProperty (DocumentID);
Rootmap.put ("Var", Var);
Template.process (Rootmap, out);
Original source http://blog.csdn.net/lsh6688/article/details/17091277
Traversing list<map<string,string>> in Freemarker