首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

struts中〈html:select嵌套使用<logic:iterate 〉的有关问题

2012-10-24 
struts中〈html:select嵌套使用logic:iterate 〉的问题?body% Vector accounts new Vector()accounts.

struts中〈html:select嵌套使用<logic:iterate 〉的问题?
<body>
  <% Vector accounts= new Vector();
  accounts.addElement("bj001");
  accounts.addElement("011011");
  request.setAttribute("accounts",accounts);
  %>
    <html:form action="selectAccount.do"  >
      <table border="0">
        <tr>
          <td>Account:</td>
          <td>
          <html:select property="account">
          <logic:iterate id="account" name="accounts">
          <html:option value="">
          <bean:write name="account"/>
          </html:option>
          </logic:iterate>
         
         
          </html:select>
          </td>
        </tr>
       
        <tr>
          <td colspan="2" align="center"><html:submit /></td>
        </tr>
      </table>
    </html:form>

上面是我的代码,我在对应的action中想取得select中选中的值,却发现无法取出;如果在select标签中用<html:option >不使用迭代输出就可以??有没有什么办法能解决用<logic:iterate >也能在action中取得选中的值?请指点
上面是我的代码,我在对应的action中想取得select中选中的值,却发现无法取出;如果在select标签中用<html:option >不使用迭代输出就可以??有没有什么办法能解决用<logic:iterate >也能在action中取得选中的值?请指点

有种标签叫nested:select
还有种标签叫nested:iterate                                              labelProperty="label"/>
                            </html:select>

and the error in your code is:
# <html:option value="">  ----value=""
#                         <bean:write name="account"/> 
#                     </html:option>            <html:option value="***">
             <bean:write name="account"/>
          </html:option>
      </logic:iterate>
</html:select> 5 楼 yjhmily 2006-11-06   其实用普通的select就可以嵌套<logic:iterate>标签了!有时候struts的标签要灵活取舍的!呵呵! 6 楼 chenzdong 2006-11-06   yjhmily 写道其实用普通的select就可以嵌套<logic:iterate>标签了!有时候struts的标签要灵活取舍的!呵呵!


不管是否使用struts的select标签,用select控件的话,也是无法实现对option value的动态赋值??如何实现? 7 楼 jin.libing 2006-12-21   jstl

热点排行