Spring Web Flow 2: problem to save multiple models with one view

2.2k views Asked by At

I have a form "mandatorydata-change.jsp" where the contact data (name, first name, ...) and the address of the user data must be specified. The contact data have his own table and the address data have his own table, so two different tables for a view. Now I want to save by Spring WebFlow 2 the contact data and address data of the user, each in its own table: "User"and "Useraddress".

The problem now is, i can't save data from TWO models in ONE view with Spring WebFlow 2.

Please can you me help?

Thanks, Lukem

1

There are 1 answers

1
Rossen Stoyanchev On

Create a single command object that encapsulates both:

public class UserModel {

  private User user;

  private UserAddress userAddress;

  // getters/setters/etc.
}