title: set content-length using MappingJacksonHttpMessageConverter
body: <p>I'm using Spring MVC to setup a REST controller that returns a JSON object, using MappingJacksonHttpMessageConverter.</p>
  
  <p>How do I tell the MappingJacksonHttpMessageConverter to also set the "Content-Length" attribute on the response header ? (By default the "Content-Length" is set to -1, as the MappingJacksonHttpMessageConverter does not calculate the JSON object length).</p>
  
  <p>I do not care if the content length calculation will affect the controller's response time (as the MappingJacksonHttpMessageConverter will need to buffer the marshalled JSON object in order to calculate its length).</p>
  
  <p>This <a href="https://stackoverflow.com/questions/12380404/how-to-have-mappingjacksonhttpmessageconverter-set-the-content-length">question was already asked</a>, however not answered.</p>