Using pagging techniques - VI
2 August 2008Now lets talk about the JSP page. We will display the list of results, and then the start, range, and results parameters are supplied to the pagination tag, which displays the total number of pages, the current page the user is on, and then links for navigating to the next page, previous page, and so on:
<c:set var="start" value="${paginationForm.start}" /> <c:set var="range" value="${paginationForm.range}" /> <c:set var="results" value="${paginationForm.results}" /> // this refers to total number of results <jsp:useBean id="start" class="java.lang.String" /> <jsp:useBean id="range" class="java.lang.String" /> <jsp:useBean id="results" class="java.lang.String" /> <pagination-tag:pager start="<%=start%>" range="<%=range%>" results="<%=results%>"/>
Now the DAO can be replaced by a session bean acting as a facade, which in turn delegates the work to an entity bean.
If you are using Oracle, you can achieve LIMIT clause functionality in MySQL like this:
SELECT * FROM TABLE WHERE {CONDITION} rownum > ? AND rownum < ?
Hope this was useful.
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Using pagging techniques - VI