• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to implement Pagination in JSP

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All ,
I am using JSR168 portlets and MVC architecture to implement pagination portlet.

Anybody can you send me code to implement pagination in JSP???

What I am trying is when the user is not selected any page or the page is first time requested then I am displaying page no 1 .

Thanks in advance,
Rajendra.
[ September 01, 2006: Message edited by: Bear Bibeault ]
 
author and cow tipper
Posts: 5000
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're trying to control which pages they see when?

Maybe some state logic. Put a flag in the user' session. If the flag is true, show them page 1, if it's false, show them page 2. Figure out which condition to change the flag on.

Not sure if this is what you're asking. Remember, you should allow the portal to decide which pages to render as much as possible. That's the mind shift you must make when you move to portal. Trying to control pages in the portal is a difficult matter - thus the creation of things like Struts Portlets and JSF portlets.
 
rajen prasad
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
My scenario is like ---> When you search something in google then it should display some no of results in first page , next page , previous page . Like this I want to develop JSP .

Anyone can help me please

thanks in advance,
Rajendra Prasad
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can implement your scenario as follows:

1. Have the pagination variable in property file, such that you can dynamically change the value.
2. create an class with Collection of search results, total results, currentPageNumber.
3. write a business logic by keeping track of on which page the user resides and pagination variable in property file.

This solution is universal in application, can be used in all portal environments.

-
Pavan Kumar Gorakavi
 
Destroy anything that stands in your way. Except this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic