2

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

skaffman
  • 398,947
  • 96
  • 818
  • 769
Lukem
  • 123
  • 2
  • 3
  • 10

1 Answers1

1

Create a single command object that encapsulates both:

public class UserModel {

  private User user;

  private UserAddress userAddress;

  // getters/setters/etc.
}
Rossen Stoyanchev
  • 4,910
  • 23
  • 26
  • Hi, Thank you for your answer... I have created a single command object and at launch "mandatorydata-change.jsp" I get the following error message: ... org.springframework.binding.expression.EvaluationException: An OgnlException occurred getting the value for expression 'myAccount.username' on context [class mmv.dto.Userdto] ... ognl.OgnlException: source is null for getProperty(null, "username") ... Do you know how in a view-state can pass two models? Thanks – Lukem Feb 09 '11 at 20:47