• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pagination using jsp

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to display 15 images in a single page.The images are getting displayed in the grid view.
I want to achieve this using pagination and dont want to display hyperlink for 1st page,2nd page.
Just i want to show the total num of pages and previous and next button image.

For Example:
---------------
prev button image 1 of 99(total number of pages) next image button.

I google it and got some idea.
On clicking the prev or next image button it calls javascript and the script calls action file.

"pagination.action?page="+page

My doubt here is how the 15 images are get called and what the functionality going after this.

P.S:may be its simple question for you guys but i dont get the idea behind this.
Sorry for asking silly question.

Regards,
ram
 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sri,

First of all no question is silly. So don't worry about asking the simplest question you have. Secondly Pagination talks about clearly on different ways of pagination.

Coming to your problem, I see two quick ways to do this.

1) Every time you invoke "next" or "previous" you make individual calls (possibly to a persistent store) to retrieve. You can keep track of what you have currently and what you want. This make sure that you have the up to date information, but the cost of expensive DB and network calls.

2) Get all the data from the DB in one single call and store them in a local list. Based on your action, you can pull the information from this local list. This would avoid the expensive calls to your DB, but the data may be stale.

In either case, once you have the required data, it is all presenting them on jsp.

If your data is mostly static and not going to change, I will go with option 2, otherwise option 1. More descriptive information is available in the link provided above.

reply
    Bookmark Topic Watch Topic
  • New Topic