<html:select property="province">
<html:option value="北京">北京</html:option>
<html:option value="上海">上海</html:option>
.
.
.
</html:select>

解决方案 »

  1.   

    这个我会了,谢谢。如果我用List来做的话,要如何配置呢?
    <%
      List ll=new ArrayList();
      String[] str={"1","北京"};  ll.add(str);
    %>
           <html:select property="province">
             <html:option collection="ll" property="str" lableProperty="北京"/>
           </html:select>
    运行时有错According to the TLDattribute value is mandatory for tag option at
      

  2.   

    你的list 里面是个String[],当然不行啦,应该用
    for (int i = 0; i < str.length; i++) {
       ll.add(str[i]);
    }就行了,其实最好两个都用list,要不然都用String[]
      

  3.   

    不是这样用的,你用错了.String[] aa = {"1","2","3","4"}
    String[] bb = {"北京","上海","天津","重庆"}<html:select property="province">
             <html:option property="aa " lableProperty="bb "/>
    </html:select>
      

  4.   

    to: whyxx(风之子) 
    你上面的不行啊,运行之后还是报错。