This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 iterating enums" Watch "Struts 2 iterating enums" New topic
Author

Struts 2 iterating enums

Diogo Gonzaga
Greenhorn

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



Thanks
Sue Temple
Greenhorn

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:


JSP:
Diogo Gonzaga
Greenhorn

Joined: Nov 04, 2008
Posts: 14
Thank you very much!!
 
I agree. Here's the link: http://kickstarter.com/rocket-mass-heater
 
subject: Struts 2 iterating enums