HTTP-based message converters

The controllers perform their main task of producing the data; this data will be presented in the view part. There are multiple ways to identify the view for representation, but a direct way is available where the object data returned from the controller is implicitly converted to an appropriate presentation for the client. The job of implicitly converting it is done by HTTP message converters. The following are the message converters provided by Spring that handle common conversions between the message and the Java objects:

  • ByteArrayHttpMessageConverter: This converts byte arrays
  • StringHttpMessageConverter: This converts Strings
  • ResourceHttpMessageConverter: This converts org.springframework.core.io.Resource for any type of octet stream
  • SourceHttpMessageConverter: This converts javax.xml.transform.Source
  • FormHttpMessageConverter: This converts form data to/from the value of type MultiValueMap<String, String>
  • Jaxb2RootElementHttpMessageConverter: This converts Java objects to/from XML
  • MappingJackson2HttpMessageConverter: This converts JSON
  • MappingJacksonHttpMessageConverter: This converts JSON
  • AtomFeedHttpMessageConverter: This converts Atom feeds
  • RssChannelHttpMessageConverter: This converts RSS feeds
  • MarshallingHttpMessageConverter: This converts XMLs
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.247.196