论坛首页 入门技术论坛

让人很苦恼的webwork select 标签问题

浏览 5056 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-07-09  
webwork action定义
ListGoods 为Map型
public String justFindGoodsItem() throws Exception{
List item1=goodsItemDao.justFindGoodsItem();
  itemGoods.put("goodsItem",item1);
                    return SUCCESS;
}
从hibernate取出数据
  public List justFindGoodsItem(){
    List goodsitem=hibernateTemplate.find("from Goodsitem");
        if(!goodsitem.isEmpty()){
        return goodsitem;
           }
         return null;
    }
在页面上先调用此action
然后<ww:select name="department" list="itemGoods"/>
出现错误如下:
org.apache.catalina.core.ApplicationContext log
信息: tag 'select', field 'list', name 'department': The requested list key 'itemGoods' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name}
恳请大家指点
   发表时间:2007-07-10  
<ww:select name="department" list="item1"/>
试试
0 请登录后投票
   发表时间:2007-07-10  
还是不行,报的错是一样的
0 请登录后投票
   发表时间:2007-07-13  
itemGoods怎么定义的啊?有getter,setter方法吗?
0 请登录后投票
   发表时间:2007-07-14  
谢谢,已经ok了,
原来select 标签中的list属性对应的自己的list,而listKey及listValue要对应自己例如item类里的属性:在这里是goodsItemid及goodsItemname
<ww:select name="goods.goodsItem"
       headerKey="-1" headerValue="请选择栏目"
    list="item1"
    listKey="goodsItemid"
listValue="goodsItemname"
       required="true"
      />
1 请登录后投票
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics