How to get datas from List<Object> (Java)?

前端 未结 5 1998
我在风中等你
我在风中等你 2020-12-31 19:12

I`m new in Java and have a problem with showing data from a list of objects. I have a simple method, which should collect data across multiple tables and return it to my con

5条回答
  •  忘掉有多难
    2020-12-31 19:41

    System.out.println("Element "+i+list.get(0));}
    

    Should be

    System.out.println("Element "+i+list.get(i));}
    

    To use the JSF tags, you give the dataList value attribute a reference to your list of elements, and the var attribute is a local name for each element of that list in turn. Inside the dataList, you use properties of the object (getters) to output the information about that individual object:

    
    ...
    
    ...
    
    

提交回复
热议问题