File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 iterating enums

 
Diogo Gonzaga
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I iterate an enum and show the value of the property.

I have an object which has an enum field, but I can't show the value (or name) of the enum restored by the database to that object.

I have tried the following in my jsp



Thanks
 
Sue Temple
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the code snippet below to iterate over a List all the time.

To quote from Struts Guide, "Iterator will iterate over a value. An iterable value can be either of: java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map, array."

Action class has

Form bean has:


JSP:
 
Diogo Gonzaga
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic