【发布时间】:2011-12-13 09:11:02
【问题描述】:
我想按索引访问值,因为我需要在列表的一半上循环并在两列上显示值...所以我需要使用索引值 + x
<c:forEach var="endValue" items="${endValue.list}" end="${lngth-1}" varStatus="status">
<c:out value="${endValue.list[status.index+5].id}"/>
</c:forEach>
显示标签值无效
编辑:
//controler
@ModelAttribute("endValue")
public EndValueListWrapper populateDataList() {
final EndValueListWrapper listForm = new EndValueListWrapper();
...
return listForm
}
public class EndValueListWrapper {
private List<EndValueForm> list;
// get and set for this list
}
public class EndValueForm{
private Strind id
...
}
【问题讨论】:
-
如果你说的是两列,为什么要
+5?介意给出更好的解释吗? -
只是一个例子...你可以删除+5,反正不起作用