I have a complex object that is composed of many of another type of object. As an example let's assume that I have a User type, and each User object contains many Address instances. Address contains a house number (int) and street name (String). I would like to make a single form to edit that user object and all of its addresses. How do I do that? I know how I would do it if User had a single Address. It would look something like the following (assuming the proper getters and setters):
//In the JSP
<s:textfield name="user.address.houseNumber/>
//In the Action
void setUser(User user) {...}
Magically, the User object would be submitted with the new house number. But how does this work when editing collections of objects like I have enumerated above? Do I have to change the name of an input tag somewhere and have some specially-named setter on the User type?