title: Passing model from controller to view
body: <p>I have an html/jsp form that I am serializing(using jquery) and passing to a spring controller via ajax. In fact it is a spring-mvc form that is bound to an attribute.</p>
  
  <p>My first question is: as I am passing the data from the form via ajax this binding is not relevant ?</p>
  
  <p>Secondly, the object it is bound to is quite a complex hibernate entity object and I am experiencing problems converting the json to an instance of the object - it has references to other objects etc etc, well actually I am not sure what the exact problems are as the error message is not particularly clear: <strong>Content type 'application/json' not supported</strong>.</p>
  
  <p>Should I use a DTO/value object instead of the entity object, and then create an entity object based on the DTO? </p>
  
  <p>Or, should I track down the problem fields in the entity object/form that are causing the json conversion to fail , this will be time-consuming and dull, but the end result seems to me to be neater.</p>
  
  <p>Suggestions welcome.</p>
  
  <p><em>edit</em>:
  Conversion of simple forms/objects is working fine when they just have a couple of string properties and related getters/setters.  <a href="https://stackoverflow.com/questions/7028507/how-do-i-return-a-view-from-a-spring-controller-using-an-ajax-request/7065292#7065292">The controller and javascript code</a>.</p>