Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert Set to List

 
Chris Blackburn
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a java.util.Set with Hibernate, and I need to convert it to a java.util.List to output to my JSP pages.
Right now I am using an Iterator and .add() to my list. This is pretty ugly.
Is there a simpler way?
Thanks,
Chris
 
Chris Blackburn
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im sorry, its been a long night. I am trying to convert it to an java.util.ArrayList.
Chris
 
Chris Harris
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,
Welcome to the Java Ranch.
You could try:

Let us know if you have any problems with this.
Chris.
 
Chris Blackburn
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works Perfect! Thnaks!
Chris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic