如何在jsp页面实现分页功能,而点击删除之后页码不会乱掉 如何在jsp页面实现分页功能,而点击删除之后页码不会乱掉 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <% int number=accounts.size();//オテオスノフニキハチソ pageCount=number%pageSize==0?number/pageSize:number/pageSize+1;//オテオスラワメウハ」ャチ橫サヨヨヒ羚ィ(number+pageSize-1)/pageSize; /*オテオスラワス睫・/ //オテオスURLエォタエオトイホハ if(request.getParameter("page")!=null) currentPage=Integer.parseInt(request.getParameter("page")); currentPage=currentPage<1?1:currentPage; currentPage=currentPage>pageCount?pageCount:currentPage; %> <%if(currentPage>1){ %> <a href="product.jsp?page=1&action=<%=action %>">ハラ メウ</a> <a href="product.jsp?page=<%=currentPage-1 %>&action=<%=action %>">ノマメサメウ</a> <%} %> <%if(currentPage<pageCount){ %> <a href="product.jsp?page=<%=currentPage+1 %>&action=<%=action %>">マツメサメウ</a> <a href="product.jsp?page=<%=pageCount %>&action=<%=action %>">トゥ メウ</a> <%} %> オレ<font color="red"><%=currentPage %></font>メウ/ケイ<font color="red"><%=pageCount %></font>メウ <table width="90%" border="1" class="datalist"> <tbody> <tr> <th scope="col">イ憘キid</th> <th scope="col">イ憘キテ﨤ニ</th> <th scope="col">イ憘キシロク・/th> <th scope="col">イ憘キテ靆・/th> <th scope="col">イ憘キヘシマ・/th> <th scope="col">イルラ・/th> </tr> <% if(!it.hasNext()){ out.print("テサモミユメオスト昕・ェオトイ憘キ"); } else{ for(int i=0;i<pageSize*(currentPage-1);i++){ it.next(); } for(int i=0;i<pageSize&&it.hasNext();i++){ Product p = it.next(); String buyActionStr = "<a href='servlet/ActionServlet?action=buy&productid=" + p.getProduct_id() + "'>ケコツ・/a>"; out.print("<tr>"); out.print("<td>" + p.getProduct_id() + "</td>"); out.print("<td>" + p.getProduct_name() + "</td>"); out.print("<td>" + p.getProduct_price() + "</td>"); out.print("<td>" + p.getProduct_descr() + "</td>");// out.print("<td>" + p.getProduct_cId() + "</td>"); out.print("<td width='100' height='75'> <image src='img/products/" + p.getProduct_image() + "' width='100' height='75'></td>"); out.print("<td>" + buyActionStr + "</td>"); out.print("</tr>"); } } %> </tbody> </table> http://www.java3z.com/cwbwebhome/article/article1/img3/pagetest.gif这是效果 java 正則多行模式匹配小問題 jbuilder编译问题 图片上某点如何加上 tooltip? [续] 初学JAVA的突破口? 文件的读写问题. 请教高手关于 JAVA SWING的JTable JB的进来看一看.急,在线等,谢谢! 高分求jabber开发高手!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 请问如何让 tree的树型结构图 的更好看一些呢? 关于扑克牌的抽取问题,希望帮帮我!52张扑克.... 谁遇到过oracle 值冲突的问题。。。好急!! poi操作word,能控制字体和颜色
int number=accounts.size();//オテオスノフニキハチソ
pageCount=number%pageSize==0?number/pageSize:number/pageSize+1;//オテオスラワメウハ」ャチ橫サヨヨヒ羚ィ(number+pageSize-1)/pageSize;
/*オテオスラワス睫・/
//オテオスURLエォタエオトイホハ
if(request.getParameter("page")!=null) currentPage=Integer.parseInt(request.getParameter("page"));
currentPage=currentPage<1?1:currentPage;
currentPage=currentPage>pageCount?pageCount:currentPage;
%>
<%if(currentPage>1){ %>
<a href="product.jsp?page=1&action=<%=action %>">ハラ メウ</a>
<a href="product.jsp?page=<%=currentPage-1 %>&action=<%=action %>">ノマメサメウ</a>
<%} %>
<%if(currentPage<pageCount){ %>
<a href="product.jsp?page=<%=currentPage+1 %>&action=<%=action %>">マツメサメウ</a>
<a href="product.jsp?page=<%=pageCount %>&action=<%=action %>">トゥ メウ</a>
<%} %>
オレ<font color="red"><%=currentPage %></font>メウ/ケイ<font color="red"><%=pageCount %></font>メウ
<table width="90%" border="1" class="datalist">
<tbody>
<tr>
<th scope="col">イ憘キid</th>
<th scope="col">イ憘キテ﨤ニ</th>
<th scope="col">イ憘キシロク・/th>
<th scope="col">イ憘キテ靆・/th>
<th scope="col">イ憘キヘシマ・/th>
<th scope="col">イルラ・/th>
</tr>
<%
if(!it.hasNext()){
out.print("テサモミユメオスト昕・ェオトイ憘キ");
}
else{
for(int i=0;i<pageSize*(currentPage-1);i++){
it.next();
}
for(int i=0;i<pageSize&&it.hasNext();i++){
Product p = it.next();
String buyActionStr = "<a href='servlet/ActionServlet?action=buy&productid="
+ p.getProduct_id() + "'>ケコツ・/a>";
out.print("<tr>");
out.print("<td>" + p.getProduct_id() + "</td>");
out.print("<td>" + p.getProduct_name() + "</td>");
out.print("<td>" + p.getProduct_price() + "</td>");
out.print("<td>" + p.getProduct_descr() + "</td>");
// out.print("<td>" + p.getProduct_cId() + "</td>");
out.print("<td width='100' height='75'> <image src='img/products/" + p.getProduct_image() + "' width='100' height='75'></td>");
out.print("<td>" + buyActionStr + "</td>");
out.print("</tr>");
}
}
%>
</tbody>
</table>