怎样分页显示,最好有源码?? 1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置Statement对象的可滚动属性然后滚动ResultSet记录数 我贴一个例子,参考一下<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %><%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %><html> <head> <title>All Employees</title> </head> <body bgcolor="white"> <%-- Set number of rows to process --%> <c:set var="noOfRows" value="2" /> <c:if test="${empList == null}"> <sql:query var="empList" scope="session" sql="SELECT * FROM Employee ORDER BY LastName" /> </c:if> <c:choose> <c:when test="${empList.rowCount == 0}"> No one seems to work here anymore ... </c:when> <c:otherwise> The following people work here: <p> <table border="1"> <th>Last Name</th> <th>First Name</th> <th>Department</th> <th>Email Address</th> <c:forEach items="${empList.rows}" var="row" begin="${param.start}" end="${param.start + noOfRows - 1}"> <tr> <td><c:out value="${row.LastName}" /></td> <td><c:out value="${row.FirstName}" /></td> <td><c:out value="${row.Dept}" /></td> <td><c:out value="${row.EmailAddr}" /></td> </tr> </c:forEach> </table> </c:otherwise> </c:choose> <p> <c:choose> <c:when test="${param.start > 0}"> <a href="foreach.jsp?start=<c:out value="${param.start - noOfRows}" />"> Previous Page</a> </c:when> <c:otherwise> Previous Page </c:otherwise> </c:choose> <c:choose> <c:when test="${param.start + noOfRows < empList.rowCount}"> <a href="foreach.jsp?start=<c:out value="${param.start + noOfRows}" />"> Next Page</a> </c:when> <c:otherwise> Next Page </c:otherwise> </c:choose> </body></html> 登录的问题 spring2.0下配置jndi遇到的很棘手的问题,急!! 新手第一次提问 希望得到大家帮助 JSP连接SQL数据库,怎么这么难啊? 请各位大哥帮忙啊! 聊天室的问题 救急。。运行JSP文件时总提示让下载保存????? 我已经学了java,JSP,但是那个开发工具下下来不能用,高手请指点,在线等!急! 帮我看看这段程序,编译出来天书,大家帮我看看怎么回事?(100分) 哪里有好的jsp的电子书下载? 大虾们,救救小弟吧!! 高手时来帮忙指点一下. 请教一下opencms6.0怎么导入自己做的模板
然后滚动ResultSet记录数
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %><html>
<head>
<title>All Employees</title>
</head>
<body bgcolor="white"> <%-- Set number of rows to process --%>
<c:set var="noOfRows" value="2" /> <c:if test="${empList == null}">
<sql:query var="empList" scope="session"
sql="SELECT * FROM Employee ORDER BY LastName"
/>
</c:if> <c:choose>
<c:when test="${empList.rowCount == 0}">
No one seems to work here anymore ...
</c:when>
<c:otherwise>
The following people work here:
<p>
<table border="1">
<th>Last Name</th>
<th>First Name</th>
<th>Department</th>
<th>Email Address</th>
<c:forEach items="${empList.rows}" var="row"
begin="${param.start}" end="${param.start + noOfRows - 1}">
<tr>
<td><c:out value="${row.LastName}" /></td>
<td><c:out value="${row.FirstName}" /></td>
<td><c:out value="${row.Dept}" /></td>
<td><c:out value="${row.EmailAddr}" /></td>
</tr>
</c:forEach>
</table>
</c:otherwise>
</c:choose>
<p>
<c:choose>
<c:when test="${param.start > 0}">
<a href="foreach.jsp?start=<c:out
value="${param.start - noOfRows}" />">
Previous Page</a>
</c:when>
<c:otherwise>
Previous Page
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${param.start + noOfRows < empList.rowCount}">
<a href="foreach.jsp?start=<c:out
value="${param.start + noOfRows}" />">
Next Page</a>
</c:when>
<c:otherwise>
Next Page
</c:otherwise>
</c:choose>
</body>
</html>