Ho qualche codice:Come impostare la lunghezza del contenuto in Spring MVC REST per JSON?
@RequestMapping(value = "/products/get", method = RequestMethod.GET)
public @ResponseBody List<Product> getProducts(@RequestParam(required = true, value = "category_id") Long categoryId) {
// some code here
return new ArrayList<>();
}
Come avrei potuto configurare Spring MVC (o MappingJackson2HttpMessageConverter.class) per impostare destra intestazione Content-Length di default? Perché ora il mio header di risposta content-length
è uguale a -1.
Si consiglia di controllare questo http://forketyfork.blogspot.com/2013/06/how-to-return-file-stream-or-classpath.html – shazin
@shazin Grazie. Non è una cattiva soluzione. Le sue opere!) – ruslanys