Thanks Shivani... Your second option will not work because the return type from List is Object and then we have to cast that object to its class to access the "name" property.
I haven't tried second one but I think it will have the casting problem too..
Thanks Shivani... Your second option will not work because the return type from List is Object and then we have to cast that object to its class to access the "name" property
Actually no, you don't have to. EL will do that for you. If you've put Person objects in a List, you don't have to cast to Person when getting the value back.