freemarker怎样通过索引拿到对应的值 100
我从后台map里放了个list,然后想遍历list的时候对list中两个索引中对象的值做比较怎么弄,代码如下,比较索引两个对象下标的值是否相等<#listcarLista...
我从后台map里放了个list,然后想遍历list的时候对list中两个索引中对象的值做比较怎么弄,代码如下,比较索引两个对象下标的值是否相等
<#list carList as obj>
<li>
${obj_index}.${obj.carbrandname == obj.carbrandname}
<#if (${obj_index.obj.carbrandname} == ${obj_index+1.obj.carbrandname})>
<h4>${obj.carbrandname}</h4>
<a class="carModel" href="javascript:void(0);" s_href="www/carmodels/carmodels?carSeriesId=${obj.id}" title="${obj.name}">${obj.name}</a>
<#else>
<a class="carModel" href="javascript:void(0);" s_href="www/carmodels/carmodels?carSeriesId=${obj.id}" title="${obj.name}">${obj.name}</a>
</#if>
</li>
</#list> 展开
<#list carList as obj>
<li>
${obj_index}.${obj.carbrandname == obj.carbrandname}
<#if (${obj_index.obj.carbrandname} == ${obj_index+1.obj.carbrandname})>
<h4>${obj.carbrandname}</h4>
<a class="carModel" href="javascript:void(0);" s_href="www/carmodels/carmodels?carSeriesId=${obj.id}" title="${obj.name}">${obj.name}</a>
<#else>
<a class="carModel" href="javascript:void(0);" s_href="www/carmodels/carmodels?carSeriesId=${obj.id}" title="${obj.name}">${obj.name}</a>
</#if>
</li>
</#list> 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏100(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询