• 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Pagination

 
Ranch Hand
Posts: 53
MyEclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to do pagination in JSP ?
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • 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
MyEclipse IDE Oracle Java
  • 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
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • 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.
 
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.
 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
Ranch Hand
Posts: 344
Oracle Java Linux
  • 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
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try Yahoo UI pagination....
 
Ranch Hand
Posts: 136
Netbeans IDE MySQL Database Java
  • 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
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
 
Saloon Keeper
Posts: 6516
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got one word for ya: DisplayTag
 
Bear Bibeault
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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".
 
Paper jam tastes about as you would expect. Try some on this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic