struts select 的问题

来源:百度知道 编辑:UC知道 时间:2024/06/02 17:49:37
<html:options collection="culturelist" property="value" labelProperty="label" />< ml:select></td>

我已经写好一个方法返回culturelist 啦,但我不知道怎末把这个culturelist 引入jsp页面,有高手给指点一下

呵呵,分数不多,给20吧

bean中 request.getSessin().setAttribute("culturelist",list);
mapping.findforward(你的页面);
页面中
先判断session中存在culturelist与否,存在即使用
<logic:present name="culturelist">
<html:options collection="culturelist" property="value" labelProperty="label" />< ml:select></td>
<!--循环输出culturelist中的属性-->
<logic:iterate id="element" name="culturelist">
<bean:write name="element" property="list中属性"/>
</logic:iterate>
</logic:present>
<!--没有culturelist的处理-->
<logic:notPresent name="culturelist">
<div align="center">
没有culturelist
</div>

</logic:notPresent>

你是想在页面显示这个list对象的内容吗
要是这样的话
你可以看看logic:iterate 这个标签
网上很多
你可以查一查的