一般使用: html:select property="region" html:option value="上海"上海/html:option html:option value="宁波"宁波/html:option /html:select 结合html:options使用: html:select property="type" html:options collection="list" prop
一般使用: <html:select property="region"> <html:option value="上海">上海</html:option> <html:option value="宁波">宁波</html:option> </html:select> 结合<html:options>使用: <html:select property="type" > <html:options collection="list" property="value" labelProperty="label" /> </html:select> java代码初始化: Vector v = new Vector(); v.add(new LabelValueBean("宁波银行", "860010030210106")); v.add(new LabelValueBean("临沂商行", "860010030210105")); v.add(new LabelValueBean("华势", "860010030210001")); request.getSession().setAttribute("list",v); 混合使用: <html:select property="region"> <html:option value="上海">上海</html:option> <html:option value="宁波">宁波</html:option> <html:options collection="listRegion" property="value" labelProperty="label"/> </html:select> java代码初始化listRegion : Vector v = new Vector(); List list = this.getJournalService().getRegionList(sql);//查库 for(int i=0;i<list.size();i++){ String temp=((Region)list.get(i)).getRegion(); v.add(new LabelValueBean(temp, temp)); } request.setAttribute("listRegion", v);