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}
恳请大家指点
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}
恳请大家指点
本文探讨了在WebWork框架中使用Hibernate进行数据查询时遇到的问题。具体表现为无法正确将查询结果传递到前端页面供下拉选择框使用,并附带了详细的代码示例及错误信息。
1105

被折叠的 条评论
为什么被折叠?



