HttpMessageConverter
converts the request into an object and vice versa.
Spring has several implementations of this interface, and you can create your own.
In this case, DispatcherServlet
does not use Model and View.
In REST, Model and View do not exist at all. There is only the data supplied by the controller and the representation of the resource when the message is converted from a media type (json, xml ...) into an object.
Converter List:
BufferedImageHttpMessageConverter
- Converts a BufferedImage
to (from) image code.
Jaxb2RootElementHttpMessageConverter
- converts xml to (from) an object marked with jaxb2 annotations. Register if jaxb2 is in classpath.
MappingJackson2HttpMessageConverter
- converts JSON to (from) an object. Register if Jackson 2 is in the classpath.
StringHttpMessageConverter
- converts all media files to text / plain.