Java Reference
In-Depth Information
</TD>
<TD ALIGN="RIGHT">
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</TABLE>
</body>
</html>
The JSP pages that support the Prev Page and Next Page buttons are as simple as the basic
ProcessSearchForm
JSP page.
SearchFormPageForward.jsp
calls the bean's
PageForward()
method to increment the page index variable by an amount equal to the page size. Here's an example:
<%@ page language="java"%>
<jsp:useBean id="SearchFormBean"
class="JavaDatabaseBible.ch15.SearchFormBean" scope="session"/>
<%=SearchFormBean.pageForward()%>
<jsp:forward page="SearchFormResultsPage.jsp"/>
SearchFormPageBack.jsp
calls the
SearchFormBean.pageBack()
method to decrement the
index by the page size. Both methods wrap the index to handle transitions through the beginning and
end of the
ResultSet
as shown here:
<%@ page language="java"%>
<jsp:useBean id="SearchFormBean"
class="JavaDatabaseBible.ch15.SearchFormBean" scope="session"/>
<%=SearchFormBean.pageBack()%>
<jsp:forward page="SearchFormResultsPage.jsp"/>
The page that
SearchFormResultsPage.jsp
creates is shown in
Figure 15-2
.