This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes Displaying search results Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Displaying search results" Watch "Displaying search results" New topic
Author

Displaying search results

Debashree Halder
Ranch Hand

Joined: Jul 27, 2005
Posts: 81
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


Debashree Halder<br />SCJP 1.5<br />Washington DC
Vipul Shinde
Greenhorn

Joined: Sep 27, 2005
Posts: 6
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

Joined: Jul 27, 2005
Posts: 81
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

Joined: Feb 10, 2005
Posts: 85
Take a look at open source displaytag, http://displaytag.sourceforge.net/
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Displaying search results
 
Similar Threads
SCBCD - Lets count
To select all checkbox across all pages in an application
How to display 10 most relevant tweets from Twitter in real-time for the keyword "@cldmgc".
disable hyper links conditionally
How to integrate progress bar between servlet and actionclass