Hi,
I need advice how to store model in spring mvc 3 with HIbernate (example on ilustration)
I have model
public class Customer{
int id;
String name;
String surname;
ArrayList<Contact> contacts;
...
getters, setters
}
Here is class Contact
public class Contact{
int id;
String address;
String phonenumber;
...
getters, setters
}
You can see a Model has array list which contains contact information for Customer, When I am creating new customer i type name and surname to input fields and from existing contacts list I want to add contact for customer. (Add contact to ArrayList). And show selected contacts in view My question is how to remember what is already added to ArrayList contacts.
I should use Session, or temp file or hidden field in view or something else? What is best solution?
Thanks