页面显示条数问题!
以下是我的程序位置
coolWebDao=this.getCoolWebDao();
List list=coolWebDao.getCoolWebList();
if(list==null){
out.print("尚无信息");
return;
}
int total=list.size();
int count=0;
Iterator it=list.iterator();
CoolWebInfo coolweb;;
while(count<(page-1)*15&&it.hasNext()){//分页显示,每页显示10条记录
it.next();
count++;
}
for(int i=0;i<=list.size();i++){
int k=0;
out.println("<tr>");
while(it.hasNext()&&k<3){
k++;
coolweb=(CoolWebInfo)it.next();
coolweb_id=coolweb.getCoolweb_id();
coolweb_name=coolweb.getCoolweb_name();
coolweb_type=coolweb.getCoolweb_type();
coolweb_http=coolweb.getCoolweb_http();
coolweb_date=coolweb.getCoolweb_date();
coolweb_address=coolweb.getCoolweb_address();
out.println("<td>我要显示的内容<td>");
}
out.println("</tr>");
}
我的目地是想让它每页显示十五条记录,第一行显示三条,显示五行。我上面的程序所显示的问题是第一行已经显示了三条,但是他会把数据库中所有的内容都显示出来,而不是显示十五条,当跳到第二页之后就会从第十六条记录显示。请问能不能让每一页只显示十五条。