request内已有集合对象 depts,内含多个dept对象,
dept对象有 id,name
编辑user对象属性.
user内含有deptSet属性,有 user.dept.id;
希望实现
显示HTML <select> 下拉框,名字deptid,有多个dept选择,默认已选择了 user.dept.id的项目。
Struts 标签怎么实现?
我用
<html:select name="deptid" >
<html:options collection="depts" property="id" labelProperty="name" />
只能实现下拉所有单位列表,但没有选择默认值,
怎么办?
request内已有集合对象 depts,内含多个dept对象,
dept对象有 id,name
------------
首先你的这个depts应该是一个容器类的对象,
如果要直接取这个对象里边的一个元素的某个属性的话,
用struts标签可能实现不了。
直接用代码写吧!