struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Bergström <>
Subject Ted Husted: html:optionsCollection & Map
Date Thu, 18 Sep 2003 11:46:17 GMT
Dear Ted,

I am trying to get my html:optionsCollection to work with a TreeMap. I
know if this is possible but on the Struts API page for the class
OptionsCollectionTag I read the following:

"The collection may be an array of objects, a Collection, an
Enumeration, an
Iterator, or a Map."

Since TreeMap implements SortedMap which is a subinterface of Map,
should work fine, right?

However, when the page is loaded I get the folloing error text:
"HTTP ERROR: 500 No getter method available for property label for bean
name 1=LabelValueBean[Label 1, Value 1]"

Can anyone explain this error message? This seems strange to me.

The returntype in my ActionFormBean is TreeMap and the code snippet
where I
build up the TreeMap is like this:

eventGroups = new TreeMap();
eventGroups.put( new String( "1" ),
                 new LabelValueBean( "Label 1",
                                     "Value 1" ) );
eventGroups.put( new String( "2" ),
                 new LabelValueBean( "Label 2",
                                     "Value 2" ) );
eventGroups.put( new String( "3" ),
                 new LabelValueBean( "Label 3",
                                     "Value 3" ) );
((EventGroupBean)form).setEventGroups( eventGroups );

Best regards


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message