本帖最后由 VC_Player 于 2011-05-11 16:03:01 编辑

解决方案 »

  1.   

    我看了下:
    <html:select property="Dept.Did" style="width:100px"><html:optionsCollection name="deptlist" label="Dname" value="Did"></html:optionsCollection></html:select> 这样的话后台得到 Did  再根据 Did 在数据库中查找到该条部门信息 Dept dept=service.findById(Did) ,然后设置到TUSER.setDept(dept); 这样在数据库中就是存的一个对象了。我做的项目中就是这样处理的。
      

  2.   

    用struts2的标签<s:select name="user.TPostDep.depId" list="usersList" listKey="TPostDep.depId" listValue="TPostDep.depName"></s:select>这样提交到后台的action中,因为action中有一个属性user,所以会生产user对象,不过只有user.TPostDep.depId不为空,其他为空。希望对你有帮助!
      

  3.   


    这个方法试过,是可以的,
    不过如果FORM中是LIST<>,所以在填充进去的时候是需要那个类得
      

  4.   


    = =汗,不会吧。。
    看来我表达能力又下降了TAT
      

  5.   


    你的意思是: 你在下拉框中选择 部门的时候可以选择多个? 然后返回到action中的就是个list?