How do you iterate through a list of objects?

后端 未结 5 823
南笙
南笙 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

    You can do like this

    
    
        
        
        
        
    
    

    Observe that no need of #list there.

    The other way is

    
    
        
        
        
        
    
    

    insetead of id give it as var.Since we don’t specify a scope for var, this new user reference exists in the default “action” scope—the ActionContext. As you can see, we then reference it with the # operator.

提交回复
热议问题