-1

I'm trying to understand what's going on behind the scenes when using the produces param of @RequestMapping (e.g. produces = MediaType.APPLICATION_JSON_VALUE )

I read somewhere that it calls MappingJackson2HttpMessageConverter? But I can't see the connection and in the Spring Doc I couldn't find what's going on behind the scenes.

GarfieldKlon
  • 11,170
  • 7
  • 31
  • 33

1 Answers1

0

Did you read this document?

https://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html

Find the "json" or "Jackson" text!

yelliver
  • 5,648
  • 5
  • 34
  • 65
  • Yes, I read that particular part about produces. But I'm interested in knowing where the connection between the defined produced media type and the called converter class is. – GarfieldKlon Apr 13 '17 at 08:37
  • if you want to know more, I think instead of reading document, you should read the spring mvc source code – yelliver Apr 13 '17 at 08:48
  • Ok I found a Bean in our application that has a member variable `private List> messageConverters;` I guess that Spring scans for _HttpMessageConvert_. This also helped me understanding it a little bit better: https://www.javacodegeeks.com/2013/07/spring-mvc-requestbody-and-responsebody-demystified.html – GarfieldKlon Apr 13 '17 at 09:28