• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pagination

 
maganti suryanarayana
Ranch Hand
Posts: 53
Java MyEclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to do pagination in JSP ?
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not much information to go on, but I'll take a guess that you want to display a table and limit the number of rows on the page. I've used JQuery and DataTables for this.

Can you tell us more about what you are trying to accomplish and what you've tried so far? Is using JavaScript an option or do you need to do it all server-side?
 
maganti suryanarayana
Ranch Hand
Posts: 53
Java MyEclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Robbins. I want to know how to do it in javascript. I am using Mysql as database, Struts as UI.
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by looking at this jQuery plugin http://datatables.net/. There are lots of examples and decent support in the forums. Make your best attempt at it and when you run into problems come back here and post your code and explain the problem clearly.

You need to understand that nobody here is going to write the code for you. We're glad to help out, but only if you show some effort.
 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maganti suryanarayana wrote:How to do pagination in JSP ?


HI
Here a nice example. Without frameworks or Scripts.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jhon masco wrote:
Here a nice example. Without frameworks or Scripts.

Nice example? It's horrible! It violates every good practice known to mankind.
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
jhon masco wrote:
Here a nice example. Without frameworks or Scripts.

Nice example? It's horrible! It violates every good practice known to mankind.

It's like watching a horror movie
 
Senthil Manoharan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try Yahoo UI pagination....
 
Sabarish Venkat
Ranch Hand
Posts: 136
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi maganti,

here is a set of codes for you try to add your own codes inside it along with the code

 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nice example? It's horrible! It violates every good practice known to mankind.


It like me because tell with details how pagination works.
I guess all the scripts and frameworks use the same metodology.
I suppose he know that he can not work with databases inside JSP pages.!!! I just wanted to show the methodology.

Salutes

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jhon masco wrote:I just wanted to show the methodology.

But the shown methodology is horrible and should not be followed.
 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
jhon masco wrote:I just wanted to show the methodology.

But the shown methodology is horrible and should not be followed.


That means than not exist a way without script or frameworks??? Why this methodology is wrong???
I am curious!!!

PD: I was looking the Sabi Swa's code and it follow this methodology.!

Thanks
 
Tim Moores
Bartender
Posts: 2946
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got one word for ya: DisplayTag
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jhon masco wrote:Why this methodology is wrong?


Because it uses many poor practices. Not only does it use scriptlets and Java code in a JSP, it actually performs the DB access in the JSP! This is an egregious violation of everything that is considered a good practice.
 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it uses many poor practices. Not only does it use scriptlets and Java code in a JSP, it actually performs the DB access in the JSP! This is an egregious violation of everything that is considered a good practice.


Yes, i know that!!!
I just want show how is the process.
Then i dont must say "methodology" , i must say "algorithm".

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're missing the point. Showing how to do it wrong is not helpful. It just makes people think that that's a good way of doing it when it's not. It's like teaching someone to cook something and saying "Here's the wrong way of doing it. Now figure out on your own what the right way is".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic