Problem with
pagination
I am facing a problem with pagination.
Collections can help you a lot in this case...... here is a skleton code which you can use to built yours....... getRec(Iterator itr) {
or else you can also use a procedure
to which gets 10 recs at a time.
I am not sure but why dont you try using the
This will give a hint to the JDBC driver as to how many records to fectch. If you need to display 10 records then you may use
However, this does not seem to be the best way since its
only a hint to the JDBC driver as to how many rows
Tips by :Vinay Pagination like Google How do I do paging in my jsp page as similar as Google does? I have 300 records to display. and i want to show 10 records per page. I would like to implement pagination as similar as Google. There are examples in the distribution bundle but basically it's like this. Suppose you've got 1000 records in a requestScope list or map called data: <display:table name="data" scope="request" id="record">
and so on... There's a manual also. And you can provide the size of the page, the styles, an url to lin on each column. You can render a column by yourself or make it to autolink if the column is an url or emailaddress... Check the examples, they tell you how to do the whole thing. Also I'll cut'n' paste here a real code of my own for you to see. It's embeded in a struts based application. See the pagesize and requestURI wich will help you do the paging. The requestURI should store the data in an attribute called "listaContactos" in scope session. I just store the data when a search is requested, the pagination is done by the displaytag so if the user don't changes the search criteria the list is the same as in the previous page but just shows up the next 10 records.... emmmh... hope to have explained, sorry my bad english: <<
<display:table sort="list" name="listaContactos"
url="/secret/gestion/editarContacto.do?accion=editar"
url="/secret/gestion/editarContacto.do?accion=editar"
url="/secret/gestion/editarEmpresa.do?accion=editar"
>> Tips by :Yayo
Related:
Java Certification, Programming, JavaBean and Object Oriented Reference Books Return to : Java Programming Hints and Tips All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|