好像没有取到值的样子: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();
ay=pb.setPageData();可以显示库里面的东西,但是点击‘下一页’跳转没有反映,好像没有取到"nextPage")的值
<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();
ay=pb.setPageData();可以显示库里面的东西,但是点击‘下一页’跳转没有反映,好像没有取到"nextPage")的值
所以应该用equalsaction == "previousPage" ==>action.equals("previousPage")
action == "nextPage" ==>action.equals("nextPage")