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 ...
随机推荐
- Linux基础知识入门
[Linux基础]Linux基础知识入门及常见命令. 前言:最近刚安装了Linux系统, 所以学了一些最基本的操作, 在这里把自己总结的笔记记录在这里. 1,V8:192.168.40.10V1: ...
- 怪胎:Android开发ImageView图片无法显示
今天碰到一个非常奇怪的问题: 在Android中ImageView无法显示加载的本地SDCard图片. 具体过程是:先调用本地照相机程序摄像,然后将拍摄的图片加载在ImageView中显示. publ ...
- 异曲同工的AWK语句,学习
输出每个IP的网络连接数,是作很多事情的第一步: netstat -nat | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n ne ...
- cv:显示Linux命令运行进度
cv: 显示 cp.mv 等命令的进度 2014-07-14 By toy Posted in Apps Edit on GitHub 在 Linux 系统中 , 大多数命令从来都是信奉 “ 沉默是金 ...
- hdu4778:状压dp+博弈
题目大意: 有g种不同颜色的小球,b个袋子,每个袋子里面有若干个每种小球 两人轮流取袋子,当袋子里面的同色小球有s个时,会合并成一个魔法球,并被此次取袋子的人获得 成功获得魔法球的人可以再次取 求二者 ...
- UVA 11478 Halum (差分约束)
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- 面试题30.最小的k个数
题目:输入n个整数,找出其中最小的k个数,例如输入4,5,1,6,2,7,3,8 这8个数字,则最小的四个数字为1,2,3,4, 这道题是典型的TopK问题,剑指Offer提供了两种方法来实现,一种方 ...
- programData
以.结束语句输入;
- 关于maven-jetty-plugin 自动重启问题
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin ...
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法
Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (d ...