tags:

views:

2263

answers:

5

I need to display the log entries from a database. Of course the log data is huge, so I have to show the results on several pages, and that **without** getting **all** the log data at once, but as the user navigates through the pages.

I know about DisplayTag and TableTags, but it seems to me that they both fetch all the data before applying pagination.

Before I start developing my own JSP tag, does anyone know of a 3rd party solution for this problem?

Thanks,
Marius

A: 

Inside your JSP is not really the good place to solve the whole problem. In a typical layered approach, you separate the presentation (JSP here) from the data access (where you do your query).

Your displaytag/jsp tag should pass to the data access layer which page it wants (eg I need the next 30 and am on page 5), and your data access layer then takes care of a paginated query.

NR
+1  A: 

Hi Marius,

Here's a link that helped us come up with a custom pagination scheme. It might help : http://www.devx.com/Java/Article/21383

+3  A: 

About DisplayTag: it does support Value List design pattern.

Manrico Corazzi
+1  A: 

Thank you all three for your very quick answers!

I chose Manrico's to be the best because I finally went with Displaytag for tables in my application, and used ValueList pattern inside it to solve the problem in this question successfully.

Thank you ddtbhai and NR for your very correct answers as well!

+1  A: 

Best solution on this is Jmesa

Ketan Khairnar