<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>ShowInverterList</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="css/stationList.css" type="text/css" />
<script type="text/javascript">
function detailStation(stationId) {
location.href="<%=basePath%>UserAction_0004!doQueryStations?stationId="+ stationId;
}
</script>
</head>
<body>
<center>
<table>
<c:forEach begin="0" step="2" varStatus="i" var="station"
items="${stations }">
<tr>
<td><div class="left_content">
<h2>
<a href="#"><c:out value="${station.stationName }"></c:out>
</a>
</h2>
<p>
<img src="images/pic.png" border="0" /><font
style="font-family: Arial;color:#68B8FF;"><b>Station
Name:</b> </font><font style="font-family:Arial;color:#666666;"> <c:out
value="${station.stationName }"></c:out> </font><br /> <font
style="font-family: Arial;color:#68B8FF;"><b>Online
Time:</b> </font><font style="font-family:Arial;color:#666666;"> <fmt:formatDate
value="${station.onlineTime }" pattern="yyyy-MM-dd" /> </font><br />
<font style="font-family: Arial;color:#68B8FF;"><b>System
Power(kWp):</b> </font><font style="font-family:Arial;color:#666666;"> <c:out
value="${station.ratedPower }"></c:out> </font> <br />
<input
style="background-image: url('images/btn.png');width: 37px;height: 28px;border: 0px;cursor: pointer;"
type="button" οnclick="detailStation('${station.stationId}')" />
</p>
</div>
</td>
<c:if test="${i.index<fn:length(stations)-1}">
<td><div class="left_content">
<h2>
<a href="#"><c:out
value="${stations[i.count*2-1].stationName }"></c:out> </a>
</h2>
<p>
<img src="images/pic.png" border="0" /><font
style="font-family: Arial;color:#68B8FF;"><b>Station
Name:</b> </font><font style="font-family:Arial;color:#666666;"> <c:out
value="${stations[i.count*2-1].stationName }"></c:out> </font><br />
<font style="font-family: Arial;color:#68B8FF;"><b>Online
Time:</b> </font><font style="font-family:Arial;color:#666666;"> <fmt:formatDate
value="${stations[i.count*2-1].onlineTime }"
pattern="yyyy-MM-dd" /> </font><br /> <font
style="font-family: Arial;color:#68B8FF;"><b>System
Power(kWp):</b> </font><font style="font-family:Arial;color:#666666;"> <c:out
value="${stations[i.count*2-1].ratedPower }"></c:out> </font> <br />
<input
style="background-image: url('images/btn.png');width: 37px;height: 28px;border: 0px;cursor: pointer;"
type="button"
οnclick="detailStation('${stations[i.count*2-1].stationId}')" />
</p>
</div>
</td>
</c:if>
</tr>
</c:forEach>
</table>
</center>
</body>
</html>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
获得集合或者数组长度:fn:length(stations)