PDA

View Full Version : mapping command object


anicraj
Jul 16th, 2007, 10:21 AM
Hi,
Am new to spring mvc. I have a form with 3 sections, and each section has to be mapped to 1 object. For ex my command object is Customer and it has a field Address which is another object which has to be mapped to address fields in the form. I gave the path as address.addressLine1 in the form but its not working, i get the following Exception thrown : org.springframework.beans.NullValueInNestedPathExc eption: Invalid property 'address' of bean class

Any help is appreciated.

Thanks

Marten Deinum
Jul 16th, 2007, 10:23 AM
If you want to bind to objects inside your command object make sure that those objects are there. So inside your Customer object create a new (empty) Address object.

That is also what the error indicates (NullValueInNestedPathException).

anicraj
Jul 16th, 2007, 10:40 AM
Thanks it worked.

And i got another question. Am trying to use MultiActionController since there are 3 submit buttons on the form and the form has lot of combo boxes and the values needs to be fetched from db. During the form load, i have to load all the values into the combo box, how can i do this? I know if use SimpleFormController, i can use formBackingObject(), not sure how to do it in MultiActionController. Any help is appreciated.

Thanks

TerpInMD
Jul 16th, 2007, 02:12 PM
wrong thread