在JSP中使用<html:options>
动态加载下拉框时,如何默认选择一个选项?
下面是我的代码:
<html:select property="menu" >
<html:option value="">–SELECT–</html:option>
<html:options collection="menuList" property="value" labelProperty="label" />
</html:select>
发布于 2011-08-23 22:44:22
您可以按如下方式指定所选项目:
<html:select property="selectedItem">
您在Action中所要做的就是从您的Form对象调用setSelectedItem("myselection")。
我假设您在这里使用Struts。
https://stackoverflow.com/questions/7162746
复制相似问题