• 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

Displaying search results

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

Here I have a query.

I have some logic for doing some search which returns say 100 results.
Now I want to segment it 10 per page (like google)and show it with 'prev' and 'next' buttons. So, if the search result is 100 it'll generate 10 pages connected by these two buttns.

How can I achieve this in JSP?

Regards,
Debashree
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

Actually all the controlling part should be either done in servlet or EJB. In your case u r using a jsp page right.

So u have to obtain a HttpSession object to create a session object. The results should be appeneded to a Vector. Then u add this Vector to session object. Then u can either forward the request using jsp tags or sendRedirect method. The Vector object can be available in the next page, so u can display the specific results on that page according to u r logic.

If this satisfies u r question , let me know.

Vipul ( shindevipul@yahoo.com)
 
Debashree Halder
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved the prob using jsp taglibs.

But still unable to solve the prob when 1 page contains multiple search results.In that case if I click 'prev' to any of the search results, all the search results showing 'prev' page.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at open source displaytag, http://displaytag.sourceforge.net/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic