File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Staggered search results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Staggered search results" Watch "Staggered search results" New topic

Staggered search results

Jenn Person
Ranch Hand

Joined: Jan 16, 2005
Posts: 89
I sincerely hope this is an appropriate forum to ask this. I'm making a cd store webapp. I have it so that the user can view lists of cds by genre. However my database has approxiamtely 100-250 cds per category. I want to format the search results so that only a certain amount like 20 or 30 results are shown per page, and links to the rest of the pages of results at the bottom like any search engine. How would I go about this?
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Look up the "LIMIT" keyword. Your RDBMS may use something slightly different.
In a nutshell, it allows you to set the number of records returned.

Also, search this and the JSP forum with the "paging" keyword.
This has been asked (and answered) many times so there is a lot of information here.
[ March 31, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jenn Person
Ranch Hand

Joined: Jan 16, 2005
Posts: 89
Awesome!! Thanks Ben, you're always so helpful!!
I agree. Here's the link:
subject: Staggered search results
It's not a secret anymore!