Hi All,
I have "CustomerGeneral" bean and i am using this as command bean in my SimpleFormController. This bean has some plain properties like firstName, lastName etc...
I am using these properties in my JSP form as spring binding like this:
<spring:bind path="customerGeneral.firstName"></spring:bind>
<spring:bind path="customerGeneral.lastName"></spring:bind>
Actually all these information like firstName, lastName are in another bean named "Contact".
Now i want to create an object of "Contact" in my command bean "CustomerGeneral" and create getter and setter methods for that. And use the firstName and lastName properties from this new bean into my JSP form page.
I have created object property for this new bean with getter and setter methods. I am using these firstName and lastName properties in my JSP form page like this:
<spring:bind path="customerGeneral.contacts.firstName"></spring:bind>
<spring:bind path="customerGeneral.contacts.lastName"></spring:bind>
but while page is loading it is throwing this error:
ERROR [org.springframework.web.servlet.tags.BindTag] - MESSAGE : Invalid property 'contacts' of bean class [com.izmocars.crm.customer
.dto.CustomerGeneral]: Value of nested property 'contacts' is null -
org.springframework.beans.NullValueInNestedPathExc eption: Invalid property 'contacts' of bean class [com.izmocars.crm.customer.dto.CustomerGeneral]: Value of
nested property 'contacts' is null
What could be wrong?
Please help me!!!


Reply With Quote