我查询出数据保存在list里 然后用struts iterator迭代显示出数据放在jsp上 我们是小项目 所以不想用数据库分页 想控制显示list来进行分页 请问 这种思路 要怎么实现

解决方案 »

  1.   

    可以用 jquery 分页插件。
      

  2.   

    先getCount()查询信息的总条数,每页显示多少条记录 ,有多少页,如每页10行 
    float count=Float.parseFloat(request.getAttribute("count").toString());
       int pageNo=(Integer)request.getAttribute("pageNo");
       int totalPage=(int)Math.ceil(count/10);
    还有个getinfo()查询符合条件的记录,在Action中写list()方法,到前台循环输出下