Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Pagination

 
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no need to put the taglib declaration in the deployment descriptor.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Removed Taglib declaration from the deployment descriptor. Its still displaying all 20 records in a page.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should i go for Display tag library?
 
Saloon Keeper
Posts: 7317
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using DisplayTag would be the standard approach for doing pagination in JSPs IMO.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 7317
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMO
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Didn't get you
 
Tim Moores
Saloon Keeper
Posts: 7317
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic