Just to share my opinion, given the problem statement, i would ask myself several questions like
What are the records that I am paginating? Are they simple records(1 or 2 columns from DB) or some table of data with several number of columns?
Is the data listing being paginated is static or dynamic?
If it is a table with several columns then how is the database designed? Is it normalized? If it is properly normalized, at an average how many tables i join to fetch the listing?
Is my application rich in GUI?
How many listings do i have to paginate?
The reasons for these questions being that, when any application is under development or initial phases of production it would be happy day scenario. As the software evolves and the user base increases the data increases. Say, if the DB is very well normalised and to fetch a listing i have to hit some 5-10 tables and day-day the data kept on increasing. Very quickly we have look in terms of performance.
Good libraries like "DisplayTag/TableSorter" is very easy to plugin and effective but (it paginates at UI level) when the day comes that you do not want to fetch all the records from DB instead you would only want just 30 records which you display in UI? Then we end up opening the opensource. We tend to do all the pagination and sorting stuff at query level.
If the number of listings that are being paginated are few, then i would go for a library like DisplayTag.
If application UI is rich (normally might not be in this case as struts 1.3 is chosen) i would go for somthing like TableSorter due to the look and feel (again i would consider the performance)
Finally if the problem statement/requirement is as minor as pagination, I would implement it based on the application needs. I would still prefer see how these DisplayTag and TableSort are implemented and make sure i get the best out of it and also make sure that i do not missout or make silly mistakes while implementing the custom solution since sometimes it gets tricky while implementing the "Page Jump" & and other types of navigations along with sorting.
However, it would be a matter of coding some 5-10 simple java files after initial analysis and design. Which sould not take much time.
Bottomline - I agree with Sreejith
Have Fun with Java
little,little.. little by little makes a lot..
Hi Pallav, 'pagination' not a big solution, share your final decision with reasons if possible (just curiosity) to close the post (might be useful for someone else). Let it be how silly or genuine it might be, it's ok.