struts的迭代标签嵌套迭代的问题
<logic:iterator>标签classFather(){Setchildren;getter...setter...}然后有List<Father>fathers...
<logic:iterator>标签
class Father(){
Set children;
getter...
setter...
}
然后有List<Father> fathers;
用logic:iterator迭代fathers是没问题的,但是在迭代fathers的时候想迭代children就会提示 Cannot find bean: "father.children" in any scope
。怎么解决这种循环嵌套问题?只能用<% %>来内嵌代码吗?
代码
<logic:iterator id="father" name="fathers">
<logic:iterator id="child" name="father.children"></logic:iterator>
</logic:iterator> 展开
class Father(){
Set children;
getter...
setter...
}
然后有List<Father> fathers;
用logic:iterator迭代fathers是没问题的,但是在迭代fathers的时候想迭代children就会提示 Cannot find bean: "father.children" in any scope
。怎么解决这种循环嵌套问题?只能用<% %>来内嵌代码吗?
代码
<logic:iterator id="father" name="fathers">
<logic:iterator id="child" name="father.children"></logic:iterator>
</logic:iterator> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询