title: Spring: Handle object with variable attributes
body: <p>I have an object that has a dynamic number of attributes. For example a page that presents a car with all its details:</p>
  
  <ul>
  <li>Model</li>
  <li>Color</li>
  <li>Price</li>
  </ul>
  
  <p>Now some privileged users can add attributes to the car object. Let's say at some point the requirement arises that any user should be able to specify the lenght of the car, so we would like to add a new attribute</p>
  
  <ul>
  <li>Length</li>
  </ul>
  
  <p>I have gotten to the point where I have the form for creating new cars that shows all fields including the additionally added ones:</p>
  
  <pre><code>    &lt;!-- ADDITIONAL ATTRIBUTES --&gt;
  
      &lt;c:forEach items="${attributes}" var="a"&gt;
  
      &lt;div class="${a}"&gt;
          &lt;span class="details_headline"&gt;${a}:&lt;/span&gt;
          &lt;input id="${a}" name="${a}" class="input" type="text" value="" placeholder="${a}"/&gt;
      &lt;/div&gt;
  
      &lt;/c:forEach&gt;
  
      &lt;!-- END ADDITIONAL ATTRIBUTES --&gt;
  </code></pre>
  
  <p>How can I now pass all these attributes to the controller that will then add the new car to my system? </p>
  
  <p>I believe the structure that I am looking for is a map containing the attribute as keys and the respective values which could then be further processed by the controller. How can I achieve this?</p>
  
  <p>Thanks!</p>