page.jsp
来自「SSH开发的电子政务系统」· JSP 代码 · 共 45 行
JSP
45 行
<%@ page contentType="text/html;charset=GB2312" %>
<!--分页开始-->
<table border="0" cellspacing="3" cellpadding="0" align="left" width="565">
<tr align="center">
<td width="80%"></td>
<td nowrap class="pageStyle">共<font color="red"><%=allCount%></font>记录</td>
<td nowrap class="pageStyle">第<font color="red"><%=currentPage%></font>/<%=allPage%>页
<td nowrap class="pageStyle">
<% if(currentPage>1){ %>
<a href="<%=request.getRequestURI()%>?currentpage=1¤tId=<%=currentId%>">首页</a>
<% }else{ %>首页<%}%>
</td>
<td nowrap class="pageStyle">
<% if(currentPage>1){ %>
<a href="<%=request.getRequestURI()%>?currentPage=<%=currentPage-1%>¤tId=<%=currentId%>">上一页</a>
<% }else{ %>上一页<%}%>
</td>
<td nowrap class="pageStyle">
<% if(currentPage<allPage){ %>
<a href="<%=request.getRequestURI()%>?currentPage=<%=currentPage+1%>¤tId=<%=currentId%>">下一页</a>
<% }else{ %>下一页<%}%>
</td>
<td nowrap class="pageStyle">
<% if(currentPage<allPage){ %>
<a href="<%=request.getRequestURI()%>?currentPage=<%=allPage%>¤tId=<%=currentId%>">尾页</a>
<% }else{ %>尾页<%}%>
</td>
<td nowrap class="pageStyle">第
<select name="select2" onchange="location.href='<%=request.getRequestURI()%>?currentId=<%=currentId%>¤tPage='+this.options[this.selectedIndex].value;">
<%
String selectedOption = "";
for(int i=1;i<=allPage;i++){
if(i==currentPage){
selectedOption = "selected";
}else{
selectedOption = "";
}
%>
<option value="<%=i%>" <%=selectedOption%>><%=i%></option>
<%}%>
</select> 页
</td>
</tr>
</table>
<!--分页结束-->
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?