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
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://aspose.com/file-tools
 
subject: Struts 2 iterating enums
 
Similar Threads
Struts2 test condition in s:if not working
Struts 2 Iterate a List of Objects
Struts 2 problem -- s:hidden
[Struts2] losing display only(prepopulated) values of the form if the validaiton fails
s:iterator question