I ran into a problem with Struts2. I have a HashMap<String, Integer>
that I use in a form with a select to choose name and corresponding id to that name.
HashMap
iterates and populates my <select>
list with names. I only need an id to pick. How do I pick an id/value instead of a name/key?
companyMap is a HashMap
, where <String, Integer>
or key, value.
companyName
is a String.
<s:select label="Pick the company name"
headerKey="-1" headerValue="Select Company name"
list="companyMap.keys"
name = "companyName"
/>