• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

Posts: 27
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author and ninkuma
Posts: 66806
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
JSP Forum Bartender
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!