title: What will be value of path attribute in spring if it has refrence of object of another class
body: <p>I am a newbie in spring mvc framework - 
  I am stuck with a problem which is something like that - </p>
  
  <p>There are classess</p>
  
  <pre><code>class User{
  private String name;
  private City city;
  //getters setters
  }
  
  class Country{
  private int id;
  private String name;
  //getters setters
  }
  
  class State{
  private int id;
  private String name;
  private Country country;
  //getters setters
  }
  
  class city{
  private int id;
  private String name;
  private State state;
  State state;
  //getters setters
  }
  </code></pre>
  
  <p>I have a form like that</p>
  
  <pre><code>&lt;form:form modelAttribute="user" method="POST"&gt;
  &lt;form:label path="name"&gt;Name&lt;/form:label&gt;
  &lt;form:input path="name"/&gt;
  
  &lt;form:label path="city.state.country"&gt;Country&lt;/form:label&gt;  //Getting error here
  &lt;form:select path="city.state.country"&gt;&lt;/form:select&gt;
  &lt;form:label path="city.state"&gt;&lt;/form:label&gt;
  &lt;form:select path="city.state"&gt;&lt;/form:select&gt;
  &lt;form:label path="city"&gt;&lt;/form:label&gt;
  &lt;form:select path="city"&gt;&lt;/form:select&gt;
  &lt;/formform&gt;
  </code></pre>
  
  <p><strong>Error</strong><br>
  <code>org.springframework.beans.NotReadablePropertyException: Invalid property 'city.state' of bean class [org.opentutor.beans.User]: Bean property 'city.state' is not readable or has an invalid getter method:</code> </p>
  
  <p>Does the return type of the getter match the parameter type of the setter?</p>
  
  <p>Basically I am confused how to set users country, state and city values.</p>