Velocity 解析多层Map
文章分类:Web前端
针对Map<String,Map<String,List>> 的情况
- #foreach($other in ${otherParamMap.keySet()})//这里是遍历第一层Map
- <table class="table_A">
- <caption>$other</caption>//取出第一层Map的key值
- <tbody>
- #foreach($key in ${otherParamMap.get($other).keySet()})//这里是遍历第二层Map
- <tr>
- <th>$key</th>//第二层Map中的key
- #foreach($grouponinfo in ${otherParamMap.get($other).get($key)}) //取出第二层Map中的值 遍历里List
- <td>$grouponinfo.id</td>//取出第二层Map中的值
- #end
- </tr>
- #end
- </tbody>
- </table>
- #end