急求JSP分页的例子
来源:百度知道 编辑:UC知道 时间:2024/05/21 06:40:18
action:
查询按钮:public ActionForward search(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
HttpSession session = request.getSession();
session.removeAttribute("pb");
session.removeAttribute("totalRows");
session.removeAttribute("map");
UserForm frm = (UserForm) form;
String user_id = frm.getUser_id();
String username = frm.getUsername();
MyMap map = new MyMap();
map.put("user_id", user_id);
map.setLike("username", username);
session.setAttribute("map", map);
DB db = new DB();
int totalRows = db.getRows("user.rows", map);
session.setAttribute("totalRows", totalRows);
PageBean pb = new PageBean(totalRows);
pb = new PageBean(totalRows);
int pageRecorders = pb.getPageRecorders();
List list = db.selectpar