Serialize ArrayList coming from a DAO
Brought to you by:
niallg
Hello,
How do you serialize/unserialize a list of objects where the top level object is an ArrayList. My example would be calling a Customer DAO and it returning a list of Customers.
I would like to be able to serialize the return list without putting that list in a wrapper class. Here is an example of the output I'm looking for.
<customers>
<customer id="1"> <customerId> 132 </customerId> ... </customer>
<customer id="2"> <customerId> 123 </customerId> ... </customer>
<customer id="3"> <customerId> 321 </customerId> ... </customer>
</customers>