码迷,mamicode.com
首页 > 其他好文 > 详细

map freemarker

时间:2015-07-01 18:53:02      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:

map freemarker遍历
fremarker中map的key必须是String,否则无法取到value。
(1)map<String,基本数据类型>
<#if clientSourceData?exists>
                <#list clientSourceData?keys as key> 
                   <tr>
                           <td>${key}</td>
                           <td>${clientSourceData【key】}</td>
                   </tr>
                </#list>
            </#if>
(2)map<String,javaBean>
                <#list clientSourceData?keys as key> 
                   <tr>
                           <td>${key}</td>
                           <td>${clientSourceData[key].id}</td>
                   </tr>
                </#list>
 (3)map<String,List<Javabean>>
             <#list clientSourceData?keys as key> 
                   <tr>
                           <td>${key}</td>
                   </tr>
                   <tr>
                       <td>
                       <table>
                           <#list clientSourceData[key] as data>
                               <tr>
                                   <td>${data.id}</td>
                               </tr>
                           </#list>
                       </table>
                       </td>
                   </tr>
                </#list>


map freemarker

标签:

原文地址:http://my.oschina.net/cavaliersyb/blog/473018

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!