• Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying search results  RSS feed

 
Debashree Halder
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • 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
 
Vipul Shinde
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Heonkoo Lee
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at open source displaytag, http://displaytag.sourceforge.net/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!