Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logic:iterate ..collection data sorting in struts

 
Dattatray Sutar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all..
I m using tomcat , struts. Is there any standard function that sorrts the columnwise data of a perticular collection.

e.g. I m using <logic:iterate>...<bean:write>...
any parameter that "iterates" through the collection as per the user wants.

Thanks a lot.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are some options:

1-Sort the list using the Collections.sort() method in your action class prior to displaying the JSP.This link shows an example of how to do this.

2-If the list is being created from a database, use the "order by" clause in your SQL to see that the rows are retrieved in the order you want.

3-Use one of the many JavaScript packages that create a sortable HTML table. These packages will usually allow you to sort by any column by clicking on the column header.
 
Dattatray Sutar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Merrill Higginson:
Here are some options:

1-Sort the list using the Collections.sort() method in your action class prior to displaying the JSP.This link shows an example of how to do this.

2-If the list is being created from a database, use the "order by" clause in your SQL to see that the rows are retrieved in the order you want.

3-Use one of the many JavaScript packages that create a sortable HTML table. These packages will usually allow you to sort by any column by clicking on the column header.



Thanks a lot for the help..it pointed me in the right direction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic