It's not a secret anymore!*
The moose likes Other Open Source Projects and the fly likes Pagination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Pagination" Watch "Pagination" New topic
Author

Pagination

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
I am working on a Servlet-hibernate application. I have a list of 20 records. I have displayed the whole 20 records in a page, but, I need to implement pagination in such a way that 5 records are displayed in a page, & it has only next button to move to another 5 records. For this i am using JSP taglib for paging. But I am facing some problem.

Here is my code :

Web.xml



This is my jsp page. (Displays the whole 20 records)
Test.jsp


Here is modified Test.jsp



I cannot even run this application, as the web.xml shows an error

Any paging strategy purely in hibernate?


kunal
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

There is no need to put the taglib declaration in the deployment descriptor.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Removed Taglib declaration from the deployment descriptor. Its still displaying all 20 records in a page.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Should i go for Display tag library?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Using DisplayTag would be the standard approach for doing pagination in JSPs IMO.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Let me tell you the actual requirement.

Its a kind of online Test application, where 5Questions are displayed in a jsp page with a NEXT button. If user clicks Next button. another set of 5Questions is displayed. I have already retrieved 25 Questions in a List. I am using hibernate as the persistent tool.

Using DisplayTag would be the standard approach for doing pagination in JSPs IMO.


What is JSPs IMO? How should i proceed?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
IMO
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Didn't get you
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Then let me rephrase my previous post with the abbreviation expanded:

Using DisplayTag would be the standard approach for doing pagination in JSPs in my opinion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pagination