日期:2014-05-18  浏览次数:20594 次

struts分页跳转问题
好像没有取到值的样子:

jsp里面部分代码:
            <bean:define   id= "pb "   name= "pb "> </bean:define>
            <bean:define   id= "ay "   name= "ay "> </bean:define>

共 <bean:write   name= "pb "   property= "maxPage "/> 页   第 <bean:write   name= "pb "   property= "curPage "/> 页   共 <bean:write   name= "pb "   property= "rowNum "/> 行信息

<logic:notEqual   name= "pb "   property= "curPage "   value= "1 "> <html:link   page= "/WebModule/tBookViewAction.do?action=previousPage "> 上一页 </html:link> </logic:notEqual>   <logic:notEqual   name= "pb "   property= "curPage "   value= "${pb.maxPage} "> <html:link   page= "/tBookViewAction.do?action=nextPage "> 下一页 </html:link> </logic:notEqual>

action部分代码:
                String   action=request.getParameter( "action ");
                String   Page=request.getParameter( "curPage ");
                int   curPage=1;
                if(action   ==   "previousPage ")
                {
                        curPage=(Integer.parseInt(Page))-1;
                        if(curPage==0)
                        {
                                curPage=1;
                        }
                }
                else   if(action   ==   "nextPage ")
                {
                        curPage=(Integer.parseInt(Page))+1;
                        if(curPage==pb.getMaxPage())
                        {
                                curPage=pb.getMaxPage();
                        }
                }
                pb.setCurPage(curPage);     //当前页等于1传入pb
                pb.setData(ay);     //传到pb的   所有信息   项
                pb.setMaxPage();     //获得页数
                pb.setRowNum();     //获得行数
                pb.setPageData();
    &