开发者

How to use the iterator tag in Struts2?

开发者 https://www.devze.com 2022-12-27 05:37 出处:网络
I have class A { private String field1; private String field2; private B b; } class B { private String field3;

I have

class A {
   private String field1;
   private String field2;
   private B b;
}

class B {
   private String field3;
}

List<A> myList;

How can I access the field3 using the myList?

This would work for field1 and field2, but how about field3?

开发者_开发技巧
 <s:iterator value="myList">
                <tr>
                    <td><s:property value="field1"/></td>
                    <td><s:property value="field2"/></td>

                </tr>
            </s:iterator>


I think it's:

b.field3


It should be b.field3

0

精彩评论

暂无评论...
验证码 换一张
取 消