JiveJdon Community Forums
在线240人   首页   主题总表   培训咨询   精华   查搜   注册    登陆
首页 » 论坛 » J2EE/JavaEE/JEE/EJB/JSF等技术讨论
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表
???en_US.forumThreadNext.name??? 下一主题
Go 总共有 2 回复 / 1
 发表新帖子   回复该主题贴
leemny

悄悄话
发表文章: 2
注册时间: 2004年05月14日 14:01
如何获取Struts2里的循环数值 2008年01月07日 17:03 到本帖网址 加入本帖到收藏夹 发送到手机 回复该主题
标签列表
我有这样一个页面
test.jsp

....
<s:iterator value="list" status="cl">

<s:checkbox name="check%{id}" theme = "simple" value="%{ischeck}"/>
<s:property value="name" />
</s:iterator>

...

意思就是,循环读取list的内容,显示name,并且在name前加个checkbox框,以后的函数将检验页面checkbox
的状态

但是问题出来了,在post以后,后台将会输出如下错误
16:43:59,174 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check1' on 'class sloa.action.RoleSetAction: Error setting expression 'check1' with value '[Ljava.lang.String;@8c0162'
16:43:59,174 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check10' on 'class sloa.action.RoleSetAction: Error setting expression 'check10' with value 'false'
16:43:59,184 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check11' on 'class sloa.action.RoleSetAction: Error setting expression 'check11' with value 'false'
16:43:59,184 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check12' on 'class sloa.action.RoleSetAction: Error setting expression 'check12' with value 'false'
16:43:59,184 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check13' on 'class sloa.action.RoleSetAction: Error setting expression 'check13' with value 'false'
16:43:59,254 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check14' on 'class sloa.action.RoleSetAction: Error setting expression 'check14' with value 'false'
16:43:59,254 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check15' on 'class sloa.action.RoleSetAction: Error setting expression 'check15' with value 'false'
16:43:59,254 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check16' on 'class sloa.action.RoleSetAction: Error setting expression 'check16' with value 'false'
16:43:59,264 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check17' on 'class sloa.action.RoleSetAction: Error setting expression 'check17' with value 'false'
16:43:59,284 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check18' on 'class sloa.action.RoleSetAction: Error setting expression 'check18' with value 'false'
16:43:59,294 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'check19' on 'class sloa.action.RoleSetAction: Error setting expression 'check19' with value 'false'


大概意思就是,要定义诸如check1的方法,才能获取checkbox1的内容
那么问题出来了
我的list是动态的,我不可能知道有多少checkbox,所以也不可能定义一大堆比如check1,check2一类的函数
来获取checkbox内容
那么有没有别的方法来获取呢?
谢谢各位
leemny

悄悄话
发表文章: 2
注册时间: 2004年05月14日 14:01
re:如何获取Struts2里的循环数值 2008年01月07日 17:04 到本帖网址 加入本帖到收藏夹 发送到手机 回复该主题
我在action里定义了很多函数比如public void setCheck(List<String> check)一类的都不好使
gougou3250

悄悄话
发表文章: 97
注册时间: 2007年05月08日 16:48
re:如何获取Struts2里的循环数值 2008年01月09日 22:13 到本帖网址 加入本帖到收藏夹 发送到手机 回复该主题
Error setting expression 'check10' with value 'false'
类型有没有问题
这个主题有 2 回复 / 1Go
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表    返回页首返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG: AOP cache 缓存 DDD EJB 集群 设计模式 Hibernate IOC JiveJdon OO RBAC Seam Spring Struts
正在读取,请等待...
google yahoo 新浪ViVi 365Key网摘 天极网摘 CSDN网摘 添加到百度搜藏 POCO网摘 博采网摘
查询本论坛内 回复超过的热门帖子
     回复该主题贴
标题
 
粗体 斜体 下划线 插入图片 插入代码 插入url链接 插入附件
内容
 

手机阅读 add to google add to yahoo
解惑之道在J道 ,打造中国最具影响力的的企业软件社区
OpenSource JIVEJDON v3.0 Powered by JdonFramework Code © 2002-08 jdon.com
anti spam