Two Laptop Bag
The moose likes Struts and the fly likes Struts 2 iterating enums Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 iterating enums" Watch "Struts 2 iterating enums" New topic

Struts 2 iterating enums

Diogo Gonzaga

Joined: Nov 04, 2008
Posts: 14
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

Sue Temple

Joined: May 01, 2010
Posts: 19
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:

Diogo Gonzaga

Joined: Nov 04, 2008
Posts: 14
Thank you very much!!
I agree. Here's the link:
subject: Struts 2 iterating enums
It's not a secret anymore!