Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Navigation

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I am facing a problem in navigating the resultset or rather to put it in simple terms, how to do page navigation
in JSP ie if there are 100 recs and we want to show only
10 recs in one page then how do we proceed?

Regds
Chibs
 
Try an URL parameter (like "startingrecord"). If it does not exist (was not passed, happens the first time the page is called) set it to 0, otherwise just go to that record (with
Code:
rs.next()
in a
Code:
for(int i = 0; i < startingrecord; i++)
with the startingrecord parameter from the URL). Then just display the next ten (or whatever) results.
You can then create links that are:

a) conditional (print only if there are previous or additional entries)
b) decreasing / increasing the URL parameter by the amount of data displayed

Don't ask me about how to get URL parameters in JSP... :~/ ...I once did this in ASP, have a look at:


Hope this helps
allow thyself to be the spark that lights the fire
haslo@haslo.ch - www.haslo.ch​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top