日期:2014-05-20  浏览次数:20666 次

java脚本替换EL
<%
List listData = (List) request.getAttribute("data");
List listHead = (List) listData.get(0);
int headLength = listHead.size();
int length = headLength + ((List) listData.get(1)).size();
int hh = length / headLength - 1;

for (int i = 0; i < listHead.size(); i++) {
out.print("<tr class='tr_show'><td>" + listHead.get(i) + "</td>");
for (int j = 0 + hh * i; j < hh * (i + 1); j++) {
out.print("<td>" + (((List) listData.get(1)).get(j)) + "</td>");
}
out.print("</tr>");
}
%>
替换成EL的大哥们 跪求

------解决方案--------------------
<c:forEach var="order" items="${data}" varStatus="sum">

</c:forEach>
------解决方案--------------------
差不多1L的,不过foreach要嵌套,<c:forEach var="i" begin="1" end="10" step="1"> 这么写