Struts : Using hashmap with html:options
843836Jul 10 2005 — edited Jun 22 2007Hi guys
I need some help with using hashmap with html: options.
I have a hashmap in which i am storing the customerID as the key and the customerBean Object as the value
// customerBean is a regular java bean with getter and setter methods like getCustomerID, getCustomerName
HashMap hashmap = new HashMap();
hashmap.put(customerBean.getCustomerID(),customerBean);
session.setAttribute("customers",hashmap);
In the jsp file, how do I use it with <html: options> tag
Something like this which does not work
<html: options collection="customers" property="customerID" labelProperty="customerName"/>;
I've been able to use vectors successfully, but i'm having difficulty with hashmaps.
Thanks for your help
Gub