How do you iterate through a list of objects?

后端 未结 5 815
南笙
南笙 2021-01-04 11:23

I have a User class that has a String username in it. I have a list of users that I\'m trying to display in a table using

                         

        
5条回答
  •  一向
    一向 (楼主)
    2021-01-04 11:58

    Struts 1.x takes care of your inner properties like this.

    < logic:iterate id="user" name="userList"> < bean:write property="${userName}"/ > < /logic:iterate>

    I guess as per ur example u can have. You may not need "#list." again in the value attribute < s:iterator value="users" id="list"> < s:property value="userName" /> < / s:iterator>

提交回复
热议问题