帮忙修改成JSP+Mysql代码分页显示
<tr><tdwidth="9"> </td><tdwidth="531"><tablewidth="525"border="0"cellpadding="0"...
<tr>
<td width="9"> </td>
<td width="531"><table width="525" border="0" cellpadding="0" cellspacing="0" class="tableBorder_LRB_dashed">
<tr>
<td align="right">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#d8d8d8" bordercolordark="#FFFFFF">
<%
BasetableFactory bf=BasetableFactory.getInstance();
Collection coll=bf.ListSoft(1000,"ORDER BY uptime DESC");
if(coll==null||coll.size()<0){%>
<tr align="center">
<td height="12" colspan="3" class="mtext">No Product! </td>
</tr>
<%
}else{ Iterator it=coll.iterator();
while(it.hasNext()){
Soft s=(Soft)it.next();
%>
<tr>
<td width="74" height="20" align="center" class="mtext">Name:</td>
<td width="238" class="ntext"> <%=s.getName()%></td>
<td width="188" rowspan="5" align="center" valign="middle" class="tableBorder"><%String path=bf.SearchHead("WHERE iid='"+s.getIid()+"'").getPath();if(path==null){out.print("无图片");}else{out.print("<img src="+path+" width=150 height=135>");}%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Version</span>:</td>
<td height="24" class="ntext"> <%=s.getEdition()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Platform</span>:</td>
<td height="24" class="ntext"> <%=s.getEnvironment()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Prices</span>:</td>
<td height="12" class="ntext"> <%=s.getPrice()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Category</span>:</td>
<td height="12" class="ntext"> <%=bf.SearchSsort("WHERE sid="+s.getSid()).getName()%></td>
</tr>
<tr align="right">
<td height="20" align="center"><span class="mtext">Introduce</span>:</td>
<td colspan="2" align="left" valign="top" class="ntext" style="padding:5px;"> <%=s.getIntroduce()%></td>
</tr>
<tr><td height="5px" colspan="3">
<hr size="1">
</td></tr>
<%}%>
</table> 展开
<td width="9"> </td>
<td width="531"><table width="525" border="0" cellpadding="0" cellspacing="0" class="tableBorder_LRB_dashed">
<tr>
<td align="right">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#d8d8d8" bordercolordark="#FFFFFF">
<%
BasetableFactory bf=BasetableFactory.getInstance();
Collection coll=bf.ListSoft(1000,"ORDER BY uptime DESC");
if(coll==null||coll.size()<0){%>
<tr align="center">
<td height="12" colspan="3" class="mtext">No Product! </td>
</tr>
<%
}else{ Iterator it=coll.iterator();
while(it.hasNext()){
Soft s=(Soft)it.next();
%>
<tr>
<td width="74" height="20" align="center" class="mtext">Name:</td>
<td width="238" class="ntext"> <%=s.getName()%></td>
<td width="188" rowspan="5" align="center" valign="middle" class="tableBorder"><%String path=bf.SearchHead("WHERE iid='"+s.getIid()+"'").getPath();if(path==null){out.print("无图片");}else{out.print("<img src="+path+" width=150 height=135>");}%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Version</span>:</td>
<td height="24" class="ntext"> <%=s.getEdition()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Platform</span>:</td>
<td height="24" class="ntext"> <%=s.getEnvironment()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Prices</span>:</td>
<td height="12" class="ntext"> <%=s.getPrice()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Category</span>:</td>
<td height="12" class="ntext"> <%=bf.SearchSsort("WHERE sid="+s.getSid()).getName()%></td>
</tr>
<tr align="right">
<td height="20" align="center"><span class="mtext">Introduce</span>:</td>
<td colspan="2" align="left" valign="top" class="ntext" style="padding:5px;"> <%=s.getIntroduce()%></td>
</tr>
<tr><td height="5px" colspan="3">
<hr size="1">
</td></tr>
<%}%>
</table> 展开
1个回答
展开全部
<tr>
<td width="9"> </td>
<td width="531"><table width="525" border="0" cellpadding="0" cellspacing="0" class="tableBorder_LRB_dashed">
<tr>
<td align="right">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#d8d8d8" bordercolordark="#FFFFFF">
<%
BasetableFactory bf=BasetableFactory.getInstance();
Collection coll=bf.ListSoft(1000,"ORDER BY uptime DESC"); //此处为从数据库中取的数据,函数需要改进,根据页数得到,如果只是实现的是假分页,则在集合显示时设置计数器,根据计数器来限制展示的内容,链接不需要传递页数。
int count=bf.getPageCount();
String pageCount=(String)session.getPageCount();
int pagecount=Integer.paseInt(pageCount);
if(coll==null||coll.size()<0){%>
<tr align="center">
<td height="12" colspan="3" class="mtext">No Product! </td>
</tr>
<%
}else{
Iterator it=coll.iterator();
while(it.hasNext()){
Soft s=(Soft)it.next();
%>
<tr>
<td width="74" height="20" align="center" class="mtext">Name:</td>
<td width="238" class="ntext"> <%=s.getName()%></td>
<td width="188" rowspan="5" align="center" valign="middle" class="tableBorder"><%String path=bf.SearchHead("WHERE iid='"+s.getIid()+"'").getPath();if(path==null){out.print("无图片");}else{out.print("<img src="+path+" width=150 height=135>");}%></td>
</tr>
<TR>
<%
if(pagecount>1)
%>
<a href=" 。。。 ?。。。&pagecount=<%= 1% >"首页 </a>
<a href=" 。。。 ?。。。&pagecount=<%= pagecount-1% >"上一页 </a>
<% else {}% >
<%
if(pagecount<count)
%>
<a href=" 。。。 ?。。。&pagecount=<%= pagecount+1% >" 下一页 </a>
><a href=" 。。。 ?。。。&pagecount=<%= count% >"尾页 </a>
<% else {}% >
</TR>
<tr>
<td height="20" align="center"><span class="mtext">Version</span>:</td>
<td height="24" class="ntext"> <%=s.getEdition()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Platform</span>:</td>
<td height="24" class="ntext"> <%=s.getEnvironment()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Prices</span>:</td>
<td height="12" class="ntext"> <%=s.getPrice()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Category</span>:</td>
<td height="12" class="ntext"> <%=bf.SearchSsort("WHERE sid="+s.getSid()).getName()%></td>
</tr>
<tr align="right">
<td height="20" align="center"><span class="mtext">Introduce</span>:</td>
<td colspan="2" align="left" valign="top" class="ntext" style="padding:5px;"> <%=s.getIntroduce()%></td>
</tr>
<tr><td height="5px" colspan="3">
<hr size="1">
</td></tr>
<%}%>
</table>
<td width="9"> </td>
<td width="531"><table width="525" border="0" cellpadding="0" cellspacing="0" class="tableBorder_LRB_dashed">
<tr>
<td align="right">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#d8d8d8" bordercolordark="#FFFFFF">
<%
BasetableFactory bf=BasetableFactory.getInstance();
Collection coll=bf.ListSoft(1000,"ORDER BY uptime DESC"); //此处为从数据库中取的数据,函数需要改进,根据页数得到,如果只是实现的是假分页,则在集合显示时设置计数器,根据计数器来限制展示的内容,链接不需要传递页数。
int count=bf.getPageCount();
String pageCount=(String)session.getPageCount();
int pagecount=Integer.paseInt(pageCount);
if(coll==null||coll.size()<0){%>
<tr align="center">
<td height="12" colspan="3" class="mtext">No Product! </td>
</tr>
<%
}else{
Iterator it=coll.iterator();
while(it.hasNext()){
Soft s=(Soft)it.next();
%>
<tr>
<td width="74" height="20" align="center" class="mtext">Name:</td>
<td width="238" class="ntext"> <%=s.getName()%></td>
<td width="188" rowspan="5" align="center" valign="middle" class="tableBorder"><%String path=bf.SearchHead("WHERE iid='"+s.getIid()+"'").getPath();if(path==null){out.print("无图片");}else{out.print("<img src="+path+" width=150 height=135>");}%></td>
</tr>
<TR>
<%
if(pagecount>1)
%>
<a href=" 。。。 ?。。。&pagecount=<%= 1% >"首页 </a>
<a href=" 。。。 ?。。。&pagecount=<%= pagecount-1% >"上一页 </a>
<% else {}% >
<%
if(pagecount<count)
%>
<a href=" 。。。 ?。。。&pagecount=<%= pagecount+1% >" 下一页 </a>
><a href=" 。。。 ?。。。&pagecount=<%= count% >"尾页 </a>
<% else {}% >
</TR>
<tr>
<td height="20" align="center"><span class="mtext">Version</span>:</td>
<td height="24" class="ntext"> <%=s.getEdition()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Platform</span>:</td>
<td height="24" class="ntext"> <%=s.getEnvironment()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Prices</span>:</td>
<td height="12" class="ntext"> <%=s.getPrice()%></td>
</tr>
<tr>
<td height="20" align="center"><span class="mtext">Category</span>:</td>
<td height="12" class="ntext"> <%=bf.SearchSsort("WHERE sid="+s.getSid()).getName()%></td>
</tr>
<tr align="right">
<td height="20" align="center"><span class="mtext">Introduce</span>:</td>
<td colspan="2" align="left" valign="top" class="ntext" style="padding:5px;"> <%=s.getIntroduce()%></td>
</tr>
<tr><td height="5px" colspan="3">
<hr size="1">
</td></tr>
<%}%>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询