<#list var as map>
<tr>
 <#list map?keys as itemKey> //关键点
    <#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>  //使用split函数,等同于java中的split函数
        <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>

后台传递过来的数据

List<LinkedHashMap<String,Object>> var = SubmitManager.getInstance().getProperty(documentId);
rootMap.put("var", var);
template.process(rootMap, out);

原文出处http://blog.csdn.net/lsh6688/article/details/17091277

freemarker中遍历list<map<String,String>>的更多相关文章

  1. Freemarker中遍历List以及内置函数使用

    在Freemarker应用中经常会遍历List获取需要的数据,并对需要的数据进行排序加工后呈现给用户. 那么在Freemarker中如何遍历List,并对List中数据进行适当的排序呢?一. Free ...

  2. js中list 和 map还有string的部分操作

    1.创建list或者数组 var list = []; list中添加元素:list.push("hello");   如果没有先定义为数组类型不能使用 push方法 判断list ...

  3. Freemarker中如何遍历List

     Freemarker中如何遍历List(附源码) 关键词(Keyword):Freemarker,Freemarker遍历list 在Freemarker应用中经常会遍历List获取需要的数据, ...

  4. Java中遍历ConcurrentHashMap的四种方式

    //方式一:在for-each循环中使用entries来遍历 System.out.println("方式一:在for-each循环中使用entries来遍历"); for(Map ...

  5. JAVA中List转换String,String转换List,Map转换String,String转换Map之间的转换类

    <pre name="code" class="java"></pre><pre name="code" cl ...

  6. jsp页面遍历List<Map<String,Object>>

    多表联查会有此类结果出现, 查阅发现基本解决思路是双重遍历,获取map,entry.value等方法. 最终发现可以使用c:forEach单次遍历,map中的key值大写,即可得到object. Co ...

  7. 入门:Java Map<String,String>遍历及修改

    重点:在使用Map时注意key-value,key用于检索value的内容. 在正常情况下,可以不允许重复:在java中分为2中情况,一是内存地址重复,另一个是不同的地址但内容相等. 在使用Map是一 ...

  8. 分页查询和分页缓存查询,List<Map<String, Object>>遍历和Map遍历

    分页查询 String sql = "返回所有符合条件记录的待分页SQL语句"; int start = (page - 1) * limit + 1; int end = pag ...

  9. List<Map<String,String>>操作(遍历,比较)

    1.List<Map<String,String>>的遍历: Map<String,String> map = new HashMap<String, Str ...

随机推荐

  1. javascript版QQ在线聊天挂件

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. centos卸载自带的apache(httpd)

    .[root@localhost etc]# rpm -qa|grep httpd,查看与httpd相关软件包. httpd--.el5_2.CentOS. .然后删除httpd: [root@loc ...

  3. Python一路走来 线程 进程

    Python线程 Threading用于提供线程相关的操作,线程是应用程序中工作的最小单元. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #!/usr/bin/env pytho ...

  4. android 巧用finish方法

    在android应用开发中,我们从一个activity跳到另一个activity时,我么要用到Intent: eg:Intent intent = new Intent(A.this,B.class) ...

  5. cf A. Down the Hatch!

    http://codeforces.com/contest/332/problem/A #include <cstdio> #include <iostream> #inclu ...

  6. Codeforces 158E Phone Talks

    http://codeforces.com/contest/158/problem/E 题目大意: 麦克是个名人每天都要接n电话,每通电话给出打来的时间和持续时间,麦克可以选择接或不接,但是只能不接k ...

  7. 从Lumia退役看为什么WP走向没落(从程序员与市场开发的角度,讲的真棒!)

    http://www.cnblogs.com/zhangkai2237/p/4856880.html

  8. js深入研究之Person类案例

    <script type="text/javascript"> /* 定义一个Person类 */ function Person(name, age) { this. ...

  9. Kuhn-Munkres算法。带权二分图匹配模板 (bin神小改版本)

    /****************************************************** 二分图最佳匹配 (kuhn munkras 算法 O(m*m*n)). 邻接矩阵形式 . ...

  10. Exchange Server 2010/2013架构改变

    Exchange Server 2010架构 Exchange Server 2013架构