本人写了这样一段代码,一直报 not bean .....错误!<html:form action="list.do">
<html:select property="list">
<html:options connection="datas" property="value" labelproperty="txt">
</html:select>
</html:form>beanForm 里面用的get/set list
datas 是Action里面通过request.setAttribute("datas",al)传到JSP的值;
al为一ArrayList集合.
al集合存放的是数据对象类 里面有方法get/set value 和get/set txt怎样才能将ArrayList里面的值利用<html:select>循环显示出来.
<html:select property="list">
<html:options connection="datas" property="value" labelproperty="txt">
</html:select>
</html:form>beanForm 里面用的get/set list
datas 是Action里面通过request.setAttribute("datas",al)传到JSP的值;
al为一ArrayList集合.
al集合存放的是数据对象类 里面有方法get/set value 和get/set txt怎样才能将ArrayList里面的值利用<html:select>循环显示出来.
解决方案 »
- struts2 注解 和freemark结合的问题
- 请教一下,关于hibernate多对多很少用..
- axis2解析list的问题
- 如何实现树形菜单
- Tomcat的web.XML的简单问题,困惑了我一个晚上.求教各位.
- 自我感觉学web比较有前途所以请大家推荐基本web的书(jsp)谢谢 想系统的学习web应该看那些书
- <jsp:useBean id="a" class="com.FormBean" scope="request"> 与 servlet
- tomcat自带的例子能运行,但是编译不通过。
- 高分请教:关闭窗口问题
- 代码实现get提交后返回结果页面html代码不齐只有3份之2的html代码为什么?
- 当jsp页面从数据库提取含中文的数据显示乱码/
- 大家推荐下哪本入门的JSP书比较好~
改成<html:options collection="datas" property="value" labelproperty="txt" />
试一下平时都是这样用的,如果有把datas扔到request的话没出现not bean found错误
<html:form action="list.do">
<html:select name="form1" property="list">
<html:options name="form1" property="value" labelproperty="txt">
</html:select>
</html:form>
其中form是你的action所对应的formbean的名字,list是你formbean中要接受value值的form,这样就可以把select选中的txt所对应的value值提交到form 中.