<#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. unresolved import 解决办法

    安装paramiko 需要先安装另两个模块 安装时未注意32bit,安装了64的,本地python是32的所以出错,重装后报错unresolved import,环境是eclipse(pydev) 用 ...

  2. Ubuntu常用命令速查手册-珍藏版-完整版

    sudo apt-get install 软件名 安装软件命令 sudo nautilus 打开文件(有root权限) su root 切换到“root” ls 列出当前目录文件(不包括隐含文件) l ...

  3. VMware Network Adapter VMnet1和VMnet8 未识别的网络的解决方法

    VMware Network Adapter VMnet1和VMnet8 被防火墙认定为未识别的网络,阻隔,无法使用端口映射,虚拟机的80端口无法传入,数据包只能出不能入.且公用网络被限制不能修改为家 ...

  4. Android 编程:calledfromWrongThreadException 的原因

    子线程更新UI会发生Android.view.ViewRoot$CalledFromWrongThreadException异常的解决方法 子线程更新UI 显然假如你的程序需要执行耗时的操作的话,假如 ...

  5. vim 中Ctags的安装和使用

    Ctags是一个用来为源文件中的标识符(如变量.函数.类成员.宏定义等)创建索引文件的程序.这些tags文件能被编辑器或其它工具用来快速查找定位源代码中的符号(tag/symbol),如变量名,函数名 ...

  6. SQL 连接 JOIN 例解。(左连接,右连接,全连接,内连接,交叉连接,自连接)

    SQL 连接 JOIN 例解.(左连接,右连接,全连接,内连接,交叉连接,自连接) 最近公司在招人,同事问了几个自认为数据库可以的应聘者关于库连接的问题,回答不尽理想-现在在这写写关于它们的作用假设有 ...

  7. 深入理解linux网络技术内幕读书笔记(一)--简介

    Table of Contents 1 基本术语 1.1 本书常用的缩写 2 引用计数 2.1 引用计数函数 3 垃圾回收 3.1 异步 3.2 同步 4 函数指针 4.1 缺点 5 goto语句 5 ...

  8. Annotation(四)——Struts2注解开发

    Hibernate和Spring框架的开发前边总结了,这次看一下流行的MVC流程框架Struts2的注解开发吧.Struts2主要解决了从JSP到Action上的流程管理,如何进行Uri和action ...

  9. java_final

  10. 利用dedecms给近三天(或当天)发布的文章显示红色日期或加上new字或new小图片

    1)红色日期 <br>[field:pubdate runphp='yes'] <br>$a="<font color=red>".strfti ...