<html:select property="creDate" size="1">
                    <logic:iterate id="show" name="searchDate" scope="request">
                        <html:option value="" ><bean:write name="show" /></html:option>
请问<html:option value="" >的值该怎么赋?  searchDate这里面方的是ArrayList<String>

解决方案 »

  1.   


    <html:options collection="searchDate" property="option的value值" labelProperty="显示值"/>
      

  2.   

    <html:options collection="searchDate" property="option的value值" labelProperty="显示值"/>
      

  3.   

    <html:options collection="searchDate" property="option的value值" labelProperty="显示值"/>property和labelProperty 写什么呢?
    我用的是 
    ArrayList<String> list = new ArrayList<String>() ;
    list的值是用数据库取的
    request.setAttribute("searchDate", list);
      

  4.   

    那你在给<html:option>赋值的时候用el表达式了
      

  5.   

    解决了
     <% ArrayList<String> list = new ArrayList<String>();
                        list = (ArrayList<String>)request.getSession().getAttribute("searchDate");
                        for(int i =list.size()-1;i>=0;i--) { %>
                            <html:option value='<%=list.get(i)%>'><%=list.get(i)%></html:option>
                        <%}%>