<html:select property="userRole">
   <c:forEach var="roles" items="${requestScope['userForm'].userRoles}">
      <html:option styleId="userRoles" value="${roles.key}"><c:out value="${roles.value}"/></html:option>      
   </c:forEach>   
</html:select>

解决方案 »

  1.   

    <html:select property="displayCnt" styleClass="font_left">
    <html:options  property="displayCntValue" labelProperty="displayCntLabel"/>
         </html:select>
    这个是我用的Formbean所以没用Vector或者Arraylist。如果用的话就得用标签<logic:iterate>建议多看看例子
      

  2.   

    我的意思是不使用任何的集合元素包括formbean因为年份,月份只是数字,只使用一个循环类似于 for (int i=0; i<n; i++) {...}这样的
    但不知道在怎么写
      

  3.   

    <select name="year" >
          <script language="Javascript">
            for(i = 1900; i < 2050; i++)
            {
              document.write("<option value=" + i + ">" + i);
            }
          </script>
        </select>