jQuery in Action, 2nd edition
The moose likes Struts and the fly likes Using commons.BeanUtils with Collections Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "Using commons.BeanUtils with Collections" Watch "Using commons.BeanUtils with Collections" New topic
Author

Using commons.BeanUtils with Collections

Suman Chaudhuri
Greenhorn

Joined: Jun 01, 2004
Posts: 13
Hi,

If I have an Employee class that has a collection of Addresses, and I want to extract Address.address1 from this collection using BeanUtils, how would I go about doing that ? I tried using BeanUtils.getNestedProperty(), but what do I pass in as the 2nd String argument ? It is expecting the nested property, but I have to traverse the collection to get each Address object and then get to the "address1" property. Any tips on this would be helpful.

If someone can give me some code that actually traverses a Collection, picks out a field in the object in that Collection and sets it to, say "", using the commons package, that would be great. de blocks.
 
IntelliJ Java IDE
 
subject: Using commons.BeanUtils with Collections
 
Threads others viewed
Cannot find bean in any scope...
Collection Storing problem
Using BeanUtils with Collections
about logic:iterate and bean:write tag
how to use hashmap in logic:iterate
IntelliJ Java IDE