wood burning stoves 2.0*
The moose likes JSP and the fly likes how to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to use "previous"  "next" buttons in a JSP page" Watch "how to use "previous"  "next" buttons in a JSP page" New topic
Author

how to use "previous" "next" buttons in a JSP page

giri shetty
Greenhorn

Joined: Jan 22, 2004
Posts: 27
Hi everybody can any one of u explain how to write a code for "next", ""previous" buttons ina jsp i will get only one record at a time if click "next' button i have to get next record and if i click "previous" button i have to get previous button.
please give me a hint
thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Welcome to the Ranch giri!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
In addition, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not abbreviating these words.
Thanks!
bear
JSP Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
It will all depend on how your data is stored and retrieved. I have a simple site with a bunch of pictures of the area. When I generate a page to show the first picture, I generate HTML links for next & prior that include picture numbers. So when you're looking at picture 2 I generate:
<a href="samepage?num=1>Prior</a> <a href="samepage?num=3">Next</a>
You need to generate buttons instead of links, but if you know HTML that should not be too tough. Where I got lucky is that I knew the picture number and the picture count.
If you're getting data from a SQL query and trying to keep track of where you are in the query results, things get tricky in a hurry. Try this thread: Pagination for more options.
[ January 22, 2004: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
 
subject: how to use "previous" "next" buttons in a JSP page
 
Similar Threads
getting previous value when using display:table
Setters not being called on bean when navigating away from JSP page
Switching between the frames
navigation problem
Which feature of Struts suits this problem better ?