我这里有个list里面有多个字段,想在下拉里面显示出来其中一个,总是出现空白,这里的嵌套标签改怎么写?
action里面:list = getLineService().getLineService();
request.setAttribute("linelist", list);
页面:
<html:select name="shipRegisterForm" property="laneCode" styleClass="box_dzzt">
<c:forEach items="${linelist}" var="row">
<html:option value="${row.lineCode}">${row.lineCode}< html:option>
</c:forEach>
       < html:select>
页面这样写也不行:  <select name="laneCode" class="box_dzzt">
               <logic:present name="linelist">
<logic:iterate id="al" name="linelist" >
<option value="${al.lineCode }">
<bean:write name="al" property="lineCode"/>
</option>
 </logic:iterate>
    </logic:present>
          < select>

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【zhanglei_1231】截止到2008-07-21 09:57:11的历史汇总数据(不包括此帖):
    发帖的总数量:13                       发帖的总分数:50                       每贴平均分数:3                        
    回帖的总数量:14                       得分贴总数量:1                        回帖的得分率:7%                       
    结贴的总数量:13                       结贴的总分数:50                       
    无满意结贴数:10                       无满意结贴分:210                      
    未结的帖子数:0                        未结的总分数:0                        
    结贴的百分比:100.00%               结分的百分比:100.00%                  
    无满意结贴率:76.92 %               无满意结分率:420.00%                  
    敬礼!
      

  2.   

    先把你要取的那个字段的值全不去出来...防在list中..
    public ArrayList getList(String sqlString, int type)
    {
    ArrayList pkv = new ArrayList(); try
    {
    conn = getConnection(type);
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery(sqlString);
    ResultSetMetaData rsmd = rs.getMetaData();
    int num = rsmd.getColumnCount();
    while (rs.next())
    {
    Hashtable table = new Hashtable();
    for (int i = 1; i <= num; i++)
    {
    String key = rsmd.getColumnName(i);
    String value = rs.getString(i);
    if (value == null) value = "";
    table.put(key, value);
    }
    pkv.add(table);
    } }
    catch (Exception e)
    {
                        e.printStackTrace();
    }
    finally
    {
    try
    {
    if (stmt != null) stmt.close();
    if (conn != null) conn.close();
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    }
    return pkv;
    }
      

  3.   

    这样
    <select name="laneCode" class="box_dzzt"> 
    <logic:iterate id="al" name="linelist" > 
    <option value="<bean:write name="al" property="lineCode"/>"/> 
    </logic:iterate> 
              < select> 
    这么写应该没问题啊你先在之前测试下list有没有值啊.