我需要根据特定列表中的“ item”值对列表进行分组。因此,每个组可能都有一个单独的列表。请提出任何建议,因为我是免费标记的新手。
*My Code:*
<#list searchdata.value as detail>
<tr>
<td>${detail_index+1}</td>
<td>${detail.season}</td>
<td>${detail.location}</td>
<td>${detail.gender}</td>
<td>${detail.item}</td> <!-- group by this-->
<td>${detail.style}</td>
<td>${detail.wash}</td>
</tr>
</#list>
答案 0 :(得分:1)
您不能在FreeMarker中做到这一点(好的,不是明智的做法)。您需要接收已经分组的数据。或者,您需要从FreeMarker调用的用Java编写的实用工具类。