NightKNigth
2017-08-27 13:14
怎么逆向输出值
User user=new User();
user.setName("袁冻");
user.setAge(1);
User user1=new User();
user1.setName("李好");
user1.setAge(2);
User user2=new User();
user2.setName("陈馨");
user2.setAge(3);
List<User> list=new ArrayList();
list.add(user0);
list.add(user1);
list.add(user2);
request.setAttribute("list",list);
<c:set var="startIndex" value="${fn:length(list)-1 }"></c:set>
<c:out value="${startIndex}"></c:out>
<c:forEach var="i" begin="0" end="${list.size()}" varStatus="status">
<c:out value="${list[startIndex-status.index].age}"></c:out>
</c:forEach>
JSP常用标签
46088 学习 · 80 问题
相似问题