关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterat
来源:互联网 发布:淘宝网小女孩衣服 编辑:程序博客网 时间:2024/06/06 04:11
struts2的checkboxlist,select等标签发生could not be resolved as a collection/array/map/enumeration/iterat错误。控制台信息如下:
tag 'select', field 'list', id 'queryType', name 'queryType': The requested list key 'statisticsType' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
at org.apache.struts2.components.Component.fieldError(Component.java:231)
at org.apache.struts2.components.Component.findValue(Component.java:293)... ... ... ... ...
出现这种错误是,刚进入jsp页面时<s:select>标签的list的值为空。解决办法就是给它赋值。
(1)jsp页面
<s:select name="queryType" list="statisticsType" listValue="dictName" listKey="id.dictCode" />
(2)action
public class S9p69Action extends WTBaseAction {
private S9p69Service s9p69Service;
private List<SptPublicDictCode> statisticsType;
private String queryType;
public String enter() {
statisticsType = s9p69Service.getPublicDictCodeList(Constant.STATISTICS_Type);
return "feeCount";
}
public String queryInfo() {
//具体逻辑,在jsp显示具体数据
return "feeCount";
}
在第一次进入jsp页面时,<action method="enter">, 这时 statisticsType 取到值。在jsp页面<select>中显示出来。
在jsp页面点击查看详情按钮,进入<action method="queryInfo">,这时 statisticsType 是去不到值的。就会报错。
解决办法是再queryInfo给statisticsType赋值。
具体代码:
public String queryInfo() {
statisticsType = s9p69Service.getPublicDictCodeList(Constant.STATISTICS_Type);
//具体逻辑,在jsp显示具体数据
return "feeCount";
}
- 关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterat
- 关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterator type异常的记录
- The requested list key 'deptlist' could not be resolved as a collection/array/map/enumeration/iterat
- The requested list key 'deptList' could not be resolved as a collection/array/map/enumeration/iterat
- Struts2 :could not be resolved as a collection/array/map/enumeration/iterator type
- could not be resolved as a collection/array/map/enumeration/iterator type的异常处理
- 报错处理:could not be resolved as a collection/array/map/enumeration/iterator type
- Select标签出现了The requested list key 'noticeType' could not be resolved as a collection/array/map/enume
- The requested list key 'map' could not be resolved as a collection/array/map/enumeration/iterator ty
- 关于The requested list key 'map' could not be resolved as a collection/array/map/enumera...
- The requested list key 'list' could not be resolved as a collection/array/map/enumeration/iterator t
- The requested list key 'map' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or peopl
- The requested list key '#request.localprovi' could not be resolved as a collection/array/map/enumera
- 关于struts2的checkboxlist、select等标签发生
- <s:doubleselect 的使用-不支持EL表达式,需要使用OGNL来动态赋值-could not be resolved as a collection/array/map/enumerati
- The requested list key could not be resolved as a collection。。。。
- tag 'select', field 'list', name 'did': The requested list key '#dList' could not be resolved as a c
- tag 'select', field 'list', name 'did': The requested list key '#id' could not be resolved as a c
- Objective-C 字符串的连接
- 探讨6410的启动过程
- 深入了解WebLogic的类装载机制详解
- SHELL DATE 命令详解
- android编译系统(android.mk)--概述+例子
- 关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterat
- iPhone中XML处理以及网络上的图片显示
- IE与火狐区别
- NSMutableURLRequest,在POST方式下传递参数
- sift算法的研究(2)编译与实现
- iPhone Bluetooth Programming
- http协议详解
- WIFI power save 模式下的数据收发
- 海量查询数据优化方案