`
sonyfe25cp
  • 浏览: 202233 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Velocity 解析多层Map

阅读更多
针对Map<String,Map<String,String>> 的情况

#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
					<td>${otherParamMap.get($other).get($key)}</td>//取出第二层Map中的值
				</tr>
			#end
			</tbody>
	</table>
	#end


ps: Velocity这玩意没法调试还真是郁闷..来来回回的试了很多次才弄对...
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics