• 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 in jsp

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to do pagination in my jsp
I have arnd 100 of records from my dataase which I am storing as a collection in my class.
Now i have to display 12 record per page as 1,2,3..Next|View All record
please help me with the idea of How to accomplish that.
 
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
Was the JSP FAQ entry on this subject not helpful?
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As said by Bear check if the JspFaq entry solves your problem. Then try a search through JSP forum .
There is also a Javaranch Journal article on pagination.

If you still face any problem let us know.


Hope this helps
 
payal Jain
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes,jsp FAQ helped me,
but I am not able to understand one thing..
I have to fetch the data depending on increasing order of date from databse.
i give todays date as input and fetch 12 records after todays date for page 1.for my page 2 i give I stores the last date of my previous page and give it as a input for page 2.Now how to do If the user clicks the page 1 again?? and what if user directly clicked page 3..then there is no proper date for me to give it as an input...

now how to resolve this...please giude me
 
Bear Bibeault
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
The SQL statement that you feed to the DB must be exactly the same each time for paging to make sense. You shouldn't be changing any of the inputs, dates or otherwise, or the results are meaningless.

The only thing that changes from query to query is the "slice" of the result set that you are obtaining (for instance, with the LIMIT keyword of MySQL).
 
The fastest and most reliable components of any system are those that are not there. 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