SoFunction
Updated on 2025-04-13

jsp hibernate's paging code page 3/3


jsp page one:
Page
Total page
="/bussiness/clInfo/?method=queryWithPage&pageMethod=
first
Previous page
Next page
Last page
" paramName="PAGER" paramProperty="currentPage" paramId="currentPage">
front page
Explain this line: "/bussiness/clInfo/?method=queryWithPage&pageMethod=first
method=queryWithPage is because my Action inherits DispatchAction, and requires a method parameter
pageMethod=first is used to determine which operation to perform in the PageHelper class
jsp page two:
<%-- Pagination Navigation --%>
<table border="0" width="780" class="pageInfo">
<tr>
<td width="250">
A total of <bean:write name="pager" property="totalRows"/><span class="pageInfo">record&nbsp;</span>
<bean:write name="pager" property="currentPage"/>/<bean:write name="pager" property="totalPages"/>
</td>
<td align="right" width="60">
<html:link page="/?viewPage=&action=first">Home Page</html:link>
</td>
<td align="right" width="60">
<logic:equal name="pager" property="hasPrevious" value="true">
<html:link page="/?viewPage=&action=previous">Previous page</html:link>
</logic:equal>
<logic:equal name="pager" property="hasPrevious" value="false">
<span class="invalidLink">Previous page</span>
</logic:equal>
</td>
<td align="center" width="4">

</td>
<td align="left" width="60">
<logic:equal name="pager" property="hasNext" value="true" >
<html:link page="/?viewPage=&action=next">Next page</html:link>
</logic:equal>
<logic:equal name="pager" property="hasNext" value="false">
<span class="invalidLink">Next page</span>
</logic:equal>
</td>
<td width="60">
<html:link page="/?viewPage=&action=last">Last page</html:link>
</td>
<td width="160" align="rigth">
<%-- to jump to the corresponding page, see the page jump section below --%>
<html:form action="/">
Jump to
<html:text property="targetPage" size="3" maxlength="3"/>
<html:submit value="GO"/>
</html:form>
</td>
<td>
</td>
</tr>
</table>
<%-- Pagination navigation ends --%>


Previous page123Read the full text