aspose file tools
The moose likes JDBC and the fly likes How to show only 10 entries in a jsp-page? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "How to show only 10 entries in a jsp-page?" Watch "How to show only 10 entries in a jsp-page?" New topic
Author

How to show only 10 entries in a jsp-page?

Gerry Mueller
Greenhorn

Joined: Dec 30, 2009
Posts: 17
Hi, I am ther again wiht a new problem.

I just have a vague idea how i can resolve the problem.
So i post this to have some idea. Perhaps you're allready do this.

The Problem: I have a database table with more than 100 entries and i would like to show these
in a jsp-page, Not a problem! (connection to database and... follow my sight)
The really problem is to show these entries only 10 per page and still have only jsp-page.

So I want to have only one jsp-page to show this entries, and in this page only 10 entries and 2 butons:
a foward and a backward one.

How can i do it. Have anybody an idea?
Please help!
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2896
    
    1

What you want to achieve is called "Pagination" and we have a beautiful link for this:
http://faq.javaranch.com/java/PaginationOrPaging


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Gabriela Cristian
Greenhorn

Joined: Dec 02, 2008
Posts: 18

Hello
you can use this simple and elegant tool: display tag. follow their example and you will see how easy it is. good luck

http://displaytag.sourceforge.net/1.2/
Prashant Saraf
Ranch Hand

Joined: Sep 25, 2006
Posts: 50

Gabriela Cristian wrote:Hello
you can use this simple and elegant tool: display tag. follow their example and you will see how easy it is. good luck

http://displaytag.sourceforge.net/1.2/


yes display tag will make it very simple.
Gerry Mueller
Greenhorn

Joined: Dec 30, 2009
Posts: 17
Hi,

thank you for your answer.
I tried it wiht displaytag-library, but it didn't work:

I write this code on my jsp-page


In this code, my table name is "lieferanten". But i got an error on TestList(10, false) (is red underlined)!
when pointing the mouse on it, it show: "TestList can't be resolved to a type"!!
Ans the tag "display:table" is yellow underlined on <display:table name="lieferanten" />
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to show only 10 entries in a jsp-page?
 
Similar Threads
Help ...Dynamic Drop Down list
How to design my application
Simple Command MVC webapp
Display JSP results in more than one screen with time gap
sectioning a recordset using jsp