freemarker中遍历list<map<String,String>>
<#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>>的更多相关文章
- Freemarker中遍历List以及内置函数使用
在Freemarker应用中经常会遍历List获取需要的数据,并对需要的数据进行排序加工后呈现给用户. 那么在Freemarker中如何遍历List,并对List中数据进行适当的排序呢?一. Free ...
- js中list 和 map还有string的部分操作
1.创建list或者数组 var list = []; list中添加元素:list.push("hello"); 如果没有先定义为数组类型不能使用 push方法 判断list ...
- Freemarker中如何遍历List
Freemarker中如何遍历List(附源码) 关键词(Keyword):Freemarker,Freemarker遍历list 在Freemarker应用中经常会遍历List获取需要的数据, ...
- Java中遍历ConcurrentHashMap的四种方式
//方式一:在for-each循环中使用entries来遍历 System.out.println("方式一:在for-each循环中使用entries来遍历"); for(Map ...
- JAVA中List转换String,String转换List,Map转换String,String转换Map之间的转换类
<pre name="code" class="java"></pre><pre name="code" cl ...
- jsp页面遍历List<Map<String,Object>>
多表联查会有此类结果出现, 查阅发现基本解决思路是双重遍历,获取map,entry.value等方法. 最终发现可以使用c:forEach单次遍历,map中的key值大写,即可得到object. Co ...
- 入门:Java Map<String,String>遍历及修改
重点:在使用Map时注意key-value,key用于检索value的内容. 在正常情况下,可以不允许重复:在java中分为2中情况,一是内存地址重复,另一个是不同的地址但内容相等. 在使用Map是一 ...
- 分页查询和分页缓存查询,List<Map<String, Object>>遍历和Map遍历
分页查询 String sql = "返回所有符合条件记录的待分页SQL语句"; int start = (page - 1) * limit + 1; int end = pag ...
- List<Map<String,String>>操作(遍历,比较)
1.List<Map<String,String>>的遍历: Map<String,String> map = new HashMap<String, Str ...
随机推荐
- ecmascript 的一些发展新动向
========== ecmascript 的一些发展新动向 (e5a57b27 - initial commit) 更弱.更受限 严格模式禁止 arguments.callee - 可以 " ...
- Vim的snipMate插件
介绍终于发现了一个插件,对于Vim下代码块的自动补全支持的很好.给大家推荐snipMate. snipMate可以帮助您在vim上实现类似Textmate的功能,自动代码块的能力非常强大,而且代码块是 ...
- 二维指针*(void **)的研究(uC/OS-II案例) 《转载》
uC/OS-II内存管理函数内最难理解的部分就是二维指针,本文以图文并茂的方式对二维指针进行了详细分析与讲解.看完本文,相信对C里面指针的概念又会有进一步的认识. 一.OSMemCreate( ) 函 ...
- linux内核学习之四:进程切换简述
在讲述专业知识前,先讲讲我学习linux内核使用的入门书籍:<深入理解linux内核>第三版(英文原版叫<Understanding the Linux Kernel>),不过 ...
- cf B. Road Construction
http://codeforces.com/contest/330/problem/B这道题可以围着一个可以与任何一个城市建路的城市建设. #include <cstdio> #inclu ...
- BZOJ2084: [Poi2010]Antisymmetry
2084: [Poi2010]Antisymmetry Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 187 Solved: 125[Submit] ...
- java.sql.SQLException:指定了无效的 Oracle URL
java.sql.SQLException:指定了无效的 Oracle URL 昨天晚上用MyEclipse连接Oracle,出现了" java.sql.SQLException: 指定了无 ...
- json对象与字符串的相互转换,数组和字符串的转换
1.json对象转换为字符串 JSON.stringify(value [, replacer] [, space]) var student = new Object(); student.id ...
- class 类(3) 继承
继承(Inheritance)是面向对象软 件技术当中的一个概念.如果一个类别A“继承自”另一个类别B,就把这个A称为“B的子类别”,而把B称为“A的父类别”,也可以称“B是A的超类”. 继承可以使得 ...
- Qt5官方demo解析集21——Extending QML - Adding Types Example
本系列全部文章能够在这里查看http://blog.csdn.net/cloud_castle/article/category/2123873 又是一个新的系列了,只是这个系列和我们之前的Chapt ...