请任何人帮助我的要求我正在编写jsp代码以从bean获取数据并以表格格式显示该数据此外我需要将下载选项放在底部以下载“csv”或“Excelsheet”中显示的表格“ 格式。
我的代码将是这样的
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import = "com.preva.vo.StoppageDetails"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/cal.css" rel="stylesheet" type="text/css" />
<link href="css/sty.css" rel="stylesheet" type="text/css" />
<link href="css/tabborder.css" rel="stylesheet" type="text/css" />
</head>
<body>
<jsp:include page="Header.jsp" />
<table align=center border=0 cellspacing=0 cellpadding=0>
<tr ><td colSpan=5 align=center><b>Overspeed Details</b></td></tr>
<tr ><td colspan=5 align=center>
<b><%=request.getParameter("vehicleId") %></b></td></tr>
<tr><td>From
<%=session.getAttribute("fromdate") %>
to
<%=session.getAttribute("startdate") %></td></tr>
</table><br></br>
<table class='rptTbl_sortable' width='80%' align=center border='0'>
<thead>
<tr class="rptHdrRow">
<th id="index" class="rptHdrCol_sort" nowrap>DeviceID</th>
<th id="date" class="rptHdrCol_sort" nowrap>Date</th>
<th id="time" class="rptHdrCol_sort" nowrap>Speed</th>
<th id="statusdesc" class="rptHdrCol_sort" nowrap>Status</th>
<th id="address" class="rptHdrCol_sort" nowrap>Address</th>
</tr>
</thead>
<tbody>
<c:forEach items="${sessionScope.overspeeddetails}" var="overspeeddetailsvar">
<tr class="rptBodyRowOdd">
<td><c:out value="${overspeeddetailsvar.deviceID}"> </c:out></td>
<td><c:out value="${overspeeddetailsvar.TIMESTAMP}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.speed}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.statuscode}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.address}"></c:out></td>
</tr>
<tr class="rptBodyRowEven">
<td><c:out value="${overspeeddetailsvar.deviceID}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.TIMESTAMP}"></c:out></td>
<td> <c:out value="${overspeeddetailsvar.speed}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.statuscode}"></c:out></td>
<td><c:out value="${overspeeddetailsvar.address}"></c:out></td>
</tr> </c:forEach>
</tbody>
</table>
</body>
</html>