javaweb编管理系统为什么查询页面不显示我数据库里的信息
if(all!=null){for(inti=0;i<all.size();i++){Useruser=(User)all.get(i);out.println("<td...
if(all != null)
{
for(int i = 0;i<all.size();i++)
{
User user =(User) all.get(i);
out.println("<td>"+user.getUserId()+"</td>");
out.println("<td>"+user.getUsername()+"</td>");
out.println("<td>"+user.getPasswd()+"</td>");
out.println("<td>"+user.getEmail()+"</td>");
out.println("<td>"+user.getGrade()+"</td>");
out.println("</tr>");
}
}
out.println("</table><br><br>");
//上一页
if(pageNow !=1)
out.println("<a href=searchuser?pageNow="+(pageNow-1)+"&username="+name+"&radtype="+type+" >上一页</a>");
//显示超链接
for(int j = pageNow;j<=pageNow+pageSize-1; j ++)
{
out.println("<a href=searchuser?pageNow="+j+"&username="+name+"&radtype="+type+" > <"+j+"> </a>");
}
int pageCount = userdao.getPageCount();
//下一页
if(pageNow != pageCount)
out.println("<a href=searchuser?pageNow="+(pageNow+1)+"&username="+name+"&radtype="+type+" >下一页</a><br><br>");
out.println("<br/>");
out.println("<br/>");
out.println("<img src='imgs/1.png' />");
out.println("</center></body>");
out.println("</html>");
out.flush();
out.close();
}
分页的代码哪里有错,急求解答!! 展开
{
for(int i = 0;i<all.size();i++)
{
User user =(User) all.get(i);
out.println("<td>"+user.getUserId()+"</td>");
out.println("<td>"+user.getUsername()+"</td>");
out.println("<td>"+user.getPasswd()+"</td>");
out.println("<td>"+user.getEmail()+"</td>");
out.println("<td>"+user.getGrade()+"</td>");
out.println("</tr>");
}
}
out.println("</table><br><br>");
//上一页
if(pageNow !=1)
out.println("<a href=searchuser?pageNow="+(pageNow-1)+"&username="+name+"&radtype="+type+" >上一页</a>");
//显示超链接
for(int j = pageNow;j<=pageNow+pageSize-1; j ++)
{
out.println("<a href=searchuser?pageNow="+j+"&username="+name+"&radtype="+type+" > <"+j+"> </a>");
}
int pageCount = userdao.getPageCount();
//下一页
if(pageNow != pageCount)
out.println("<a href=searchuser?pageNow="+(pageNow+1)+"&username="+name+"&radtype="+type+" >下一页</a><br><br>");
out.println("<br/>");
out.println("<br/>");
out.println("<img src='imgs/1.png' />");
out.println("</center></body>");
out.println("</html>");
out.flush();
out.close();
}
分页的代码哪里有错,急求解答!! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询