代码[list=1]<pg:pager items=\"${totalRows} \" url=\"/PageAction.do?pagesize=5\"
这样传递参数不对,应该写成:
代码[list=1]<pg:pager items=\"${totalRows}\" url=\"/PageAction.do\"maxIndexPages=\"5\">
<pg:param name=\" pagesize \" value=\"5\" />
另外由于不需要在页面分页所在<pg:param>要去调
再就是<pg:pager>要有items属性
六.以下是Demo代码
代码[list=1]<pg:pager
items=\"${ totalRows }\" url=\"/PageAction.do\"
index=\"half-full\" maxPageItems = \"5\"
maxIndexPages=\"10\" isOffset = \"<%=false%>\" export = \"pageOffset,currentPageNumber=pageNumber\"
scope = \"request\"> <pg:param name=\"pagesize\" value=\"5\" />
<table align=\"center\">
<c:forEach items=\"${userlist}\" var=\"user\"> <!--pg:item-->
<tr> <td height=\"39\">${user.userId}</td>
<td height=\"39\">${user.username}</td> <td height=\"39\">${user.password}</td>
</tr> <!--/pg:item-->
</c:forEach> </table>
<pg:index> <center>
<table border=0 cellpadding=0 width=10% cellspacing=0> <tr align=center valign=top>
<td valign=bottom><font face=arial,sans-serif size=-1>Result Page: </font></td>
<pg:prev ifnull=\"true\"> <% if (pageUrl != null) { %> [Page]
<td alig