<html:select property="test">
  <html:option value="1">男</html:option>
  <html:option value="2">女</html:option>
</html:select>

解决方案 »

  1.   

    数据库
    <html:select property="test">
    while(rs.next()){
      <html:option value='<%=rs.getString()%>'><%=rs.getString()%></html:option>
      }
    </html:select>
      

  2.   

    <html:select name="test" value="">
       <html:optionsCollection name="xblist" />   
    </html:select>其中xblist是一个基于struts的LabelValueBean的Collection
      

  3.   

    select a as label, b as value from...获得
      

  4.   

    数据库
    <html:select property="test">
    while(rs.next()){
      <html:option value='<%=rs.getString()%>'><%=rs.getString()%></html:option>
      }
    </html:select>
    这种写法编译不通过
      

  5.   

    看看下面幾個帖子:http://expert.csdn.net/Expert/topic/2750/2750828.xml?temp=.6085932
    http://expert.csdn.net/Expert/topic/2808/2808299.xml?temp=.3831598
    http://expert.csdn.net/Expert/topic/2673/2673856.xml?temp=.6826288
    http://expert.csdn.net/Expert/topic/2252/2252645.xml?temp=.6023371