Prodigy/kf智
          我的博客
          posts - 20,comments - 7,trackbacks - 0
          ShowlistAction 處理請求然后根據(jù) 具體進(jìn)行分頁 //Created by MyEclipse Struts // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xsl package com.xiaozhi.pagebean; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.xiaozhi.user.User; /** * MyEclipse Struts * Creation date: 04-06-2006 * * XDoclet definition: * @struts.action input="/errors/errors.jsp" validate="true" */ public class ShowlistAction extends Action { public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) { User us = new User() ; List list = us.select_find() ; request.setAttribute("list",list) ; String pn = request.getParameter("pn"); if(pn == null) { pn = "0" ; } int page = Integer.parseInt(pn) ; System.out.println("#############"+page+"###########") ; //創(chuàng)建分頁實例 PageBean pb = new PageBean() ; //設(shè)置每頁顯示的數(shù)目 pb.setEverypage(3) ; //先設(shè)置最多有多少個數(shù)據(jù) 根據(jù)他得到一共有多少頁 pb.setCountdata(list.size()) ; //設(shè)置當(dāng)前頁面 pb.setCurrentPage(page) ; request.setAttribute("pbs",pb) ; return mapping.findForward("show"); } }
          posted on 2006-04-17 11:22 xiaozhi 閱讀(249) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 平谷区| 绥宁县| 宜阳县| 彭水| 永丰县| 长宁区| 和田市| 无锡市| 探索| 当涂县| 安乡县| 科尔| 昌江| 军事| 新竹市| 巴林右旗| 普陀区| 上杭县| 常熟市| 承德县| 岐山县| 麦盖提县| 黔西县| 曲松县| 威海市| 滁州市| 庄浪县| 黄山市| 水富县| 仙居县| 天水市| 惠东县| 阜康市| 枝江市| 武威市| 霸州市| 邵武市| 沾化县| 天全县| 龙州县| 自治县|