Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How can I divide the result of a query in several JSP files?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a web application and I'm using Hibernate + Spring + Struts 2.

I have a transporters class where I have a lot of information about them. I have about 400 transporters and when I show a list of transporters I don't know how divide the list in several JSP files.

I would like to get a list of 10 transporters and show another 10 tranporters if I click a next buttom and so on...

Is possible do that? Is very heavy for my application to show all the transporters (about 400 transporters)

I have been thinking about it and I have no idea how can I do it.
Any advice?

Thanks and sorry for my english!

-Samuel-
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The term you're looking for is "pagination" or "paging": https://coderanch.com/how-to/java/PaginationOrPaging
 
Samuel Castillo Romero
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:The term you're looking for is "pagination" or "paging": https://coderanch.com/how-to/java/PaginationOrPaging



hehehe I didn't know the name of the term!!

I'm going to read about "pagination" and try to use it with Struts 2

Thanks for all buddy!!

-Samuel-
 
Samuel Castillo Romero
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again!

I'm trying to use Display tag but I can't.

I have a JSP file and if I try to put this "code" in my file I get an unhandled exception.

This is the code that I put in my JSP file (I know, is a stupid code, but I'm only want to know if Display tag works or not)



and this is the error:



Any advice?

Thanks!
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DisplayTag consists of numerous jar files; did you copy them all to your web app's WEB-INF/lib directory? Particularly one called commons-lang-XYZ.jar? That's the missing one "java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException" is complaining about.
 
Samuel Castillo Romero
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:DisplayTag consists of numerous jar files; did you copy them all to your web app's WEB-INF/lib directory? Particularly one called commons-lang-XYZ.jar? That's the missing one "java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException" is complaining about.



That was!!

Thanks for all!!

I have added this jar files which I didn't have in my application:

commons-beanutils
commons-lang
commons-collections


-Samuel
 
Samuel Castillo Romero
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again!

I have resolved the problem with display tag and now it works nice but I would like to change somethings and I don't know how.

The result of my data table is something like this:




***I would like to change the languaje of this sentence:
"13 items found, displaying all items"

***I would like to show borders in my data table.

And finally...

***I would like to change the id (1,2,3,4,5,6,7...) to the sentence "Ver más". I would like that always show "Ver mas" althought, really the value of this field is the id. My code is:


This is the column but if I use property = "id" then I can't use value = "Ver más"

Thanks in advance!!
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you check the DisplayTag web site? It has tutorials on just about all aspects that are customizable.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic