About HDPagination


HDPagination is a framework library designed to simply coding of pagination search over large result set in J2EE. The based idea is every time it loads only the particular page of data rather than all records, which satisfy the input search criteria, from database.

Pagination is a key part in web system design both from UI perspective (it makes UI friendly to user) and performance perspective in server side (it makes server to service request more rapidly).

Generally speaking, there are 2 strategies which can be used to implement pagination in a J2EE web application. The first approach is to load all data from database based on received search criteria input, then save the result as an attribute in session. This method works very well if the search result is small and can avoid hitting database when user navigates through other pages (e.g. by clicking "previous" or "next" page links). However, when data becomes big it can cause a big performance problem because saving huge amount of data in session will cost a lot of memory. The second approach is to load only one page of data from database and save the data in request. When user navigates to other pages, the same searching criterion is used to load that page of data from database and the loaded data is saved in request again. The second approach is more reliable than the first one. Although it has slightly slower response time compared to the first approach when user navigates to other pages, it can scale transparently for large result sets and high request column. For this reason, it is thought to be an ideal solution in a critical enterprise application.

Now let's talk more about the second strategy. To implement the whole functionality of a pagination search, it may include some steps:

Next Page