1.List(mebers是list的名字 meber是list里面的对象 $!meber非空判断)
#foreach($!member in $members)
<li>$!member.email - $!member.firstname $!member.lastname</li>
#end
2.Map
Map遍历的方法(这种map的结构是map里面带list)
①#foreach($couponList in $resultMap.entrySet())
#foreach($coupon in $couponList)
<li>
<label>券号:$!{coupon.couponNo}</label>
</li>
<li>
<label>面额:$!{coupon.couponAmount}</label>
</li>
<li>
<label>券类型:$!{coupon.couponType}</label>
</li>
<li>
<label>使用终端:$!{coupon.terminalType}</label>
</li>
<li>
<label>优惠说明:$!{coupon.discountDesc}</label>
</li>
<li>
<label>使用规则:$!{coupon.couponDesc}</label>
</li>
#end
②遍历map中的key
Java代码
#foreach($infos in $lineBusiness.keySet())
${infos}
#end
遍历map中的value
Java代码
#foreach($infos in $lineBusiness.values())
${infos}
#end
另一种map遍历
Map<K,V> map = new LinkedHashMap() ;
#foreach($infos in $lineBusiness.entrySet())
${infos.key} ${infos.value}
#end