Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get datas from List<Object>?  RSS feed

Charles Conneley
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I`m new in Java and have a problem with showing datas from a list of objects. I have a simple mtehod, which should collect datas across multiple tables and return it to my controller:

Now I want to get this datas in controller, but I don`t know how to get single results from the list. I tried to do something like this:

but I`m getting only references to this objects (for example [Ljava.lang.Object;@167a47b). I also tried to use Iterator, but the result is the same. I tried to use a code like this:

but it doesn`t help me too - this ends with a compile error.

Can someone tell me how to get an 'id'(integer value) from this list?
I`m using MyFaces in my 'View' where I have a code like this (houseControll is the name of my JSF Managed Bean - the controller):

this code shows an 'id' value properly - I have 1,2,3,... values. How I can get the same result in my controller? How to show the datas in controller?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!