aspose file tools*
The moose likes Struts and the fly likes How can I divide the result of a query in several JSP files? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How can I divide the result of a query in several JSP files?" Watch "How can I divide the result of a query in several JSP files?" New topic
Author

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

Samuel Castillo Romero
Greenhorn

Joined: Dec 21, 2010
Posts: 26
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-
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
The term you're looking for is "pagination" or "paging": http://www.coderanch.com/how-to/java/PaginationOrPaging


Ping & DNS - my free Android networking tools app
Samuel Castillo Romero
Greenhorn

Joined: Dec 21, 2010
Posts: 26
Ulf Dittmer wrote:The term you're looking for is "pagination" or "paging": http://www.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

Joined: Dec 21, 2010
Posts: 26
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
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
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

Joined: Dec 21, 2010
Posts: 26
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

Joined: Dec 21, 2010
Posts: 26
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
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
Did you check the DisplayTag web site? It has tutorials on just about all aspects that are customizable.
 
Don't get me started about those stupid light bulbs.
 
subject: How can I divide the result of a query in several JSP files?