Sorry for the late response.
I wouldn't use a Map, I would go with a List. Primarily for ordering. There's nothing more strange than hitting a web site and seeing the order of some select box changing randomly with each refresh. I suppose you could get away with one of those funkified Map impls over in commons that will maintain order.
Just my $0.02
-- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx
----- Original Message ----- From: "David Johnson" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Monday, March 07, 2005 11:33 AM
Subject: Displaying a HashMap as a <select>
Hi all
I have a HashMap in my application context called "codes" that contains a bunch of key,value pairs where the key is an Integer representing the codeID and the value is a string representing the codeName
I simply want to create a select box containing all the items in my HashMap (displaying the codeName but passing the codeID)
What's the easiest way to do this? Can I do this wil just a vanilla HashMap? The examples are slightly confusing.
help!
Also, keep in mind if the way I have the data stored (in a HashMap called "codes on the application context) wont work, is there a better way to do it?
-- -Dave [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]