我用的form是DynaActionForm 从DB拿到的一个LIST 中有一个字段是我前台要用的,要放在一个SELECT里边, 中间想放到request里边,然后通过<html:select>这个标签拿到该字段的集合,但是不知道怎么写,各位大虾帮帮忙,具体应该怎么放,给小弟个例子,谢谢
解决方案 »
- jsp网页想实现一种效果,请各位大侠进来看看
- hibernate update问题
- 编写三个线程分别显示各自的运行时间,第一个线程每隔1秒钟运行一次,第二个线程每隔5秒钟运行一次,第三个线程每隔10秒钟运行一次。
- 编码转化求教
- Axis 的基础问题,高手来看看
- 关于JSP页面和MYSQL连接!
- 网站今天终于上线了!高兴!散分!来者有份!up有分!
- 求 人才招聘网站 求职模块的 uml 的设计图和rose工具使用教程。
- 一个oracle的简单问题!
- 鼓舞一下士气...放分..
- 这是什么问题啊??????????????????????????????????????????????????????????????????????????
- 求教:一个和模式稍有关系的问题
<html:optionsCollection label="" name=""></html:optionsCollection>
</html:select>
list.add(new org.apache.struts.util.LabelValueBean("管理员",
"admin"));
list.add(new org.apache.struts.util.LabelValueBean("客人","guest"));
request.setAttribute("list",list);
%>
<html:form action="/admin" scope="request">
id : <html:select property="id">
<html:options collection="list" property="value" labelProperty="label"/> </html:select>
<html:submit/><html:cancel/>
</html:form>
ActionForm 里:private java.lang.String userid="admin"; //默认值Action里:form.setUsrid("guest");//修改默认值
//设置下拉选项
List list= new java.util.ArrayList();
list.add(new org.apache.struts.util.LabelValueBean("管理员",
"admin"));
list.add(new org.apache.struts.util.LabelValueBean("客人","guest"));
request.getSession().setAttribute("list",list);
return mapping.findForward("index");jsp里:
<html:select property="userid">
<html:options collection="list" property="value" labelProperty="label"/>
</html:select>