ArrayList productList = new ArrayList();
CProduct product = new CProduct(); product.setId(new Integer(1)); product.setName("My Product");
productList.add(product);
request.setAttribute("products",productList.toArray());
...
<html:option value="">--</html:option>
<html:options collection="products" property="id" labelProperty="name" />
If you dont want to have a refering action then you can have an action that returns null rather than a forward. and do this in jstl
<c:import url="/product/list.do" />
Cheers Mark
On 2 Feb 2004, at 13:11, Otto, Frank wrote:
hello,
I have following bean:
public class CProduct {
private Integer id;
private String name
public Integer getId() {return id;} puclic void setId(Integer id){ ... }
My form class contains a java.util.List of CProduct bean.
How can I display the List as select box? I want to use the id as value and the name as label of the select box.
For example:
<select name="ref"> <option value="1">scanner</option> <option value="2">harddisk</option> </select>
Has anyone an idea?
Regards,
Frank
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]