Site hosted by Angelfire.com: Build your free website today!

 

 

The @ResponseBody notation is similar to @RequestBody. This expansion can be put on a method and indicates that the income type should be codified straightarrow to the HTTP greeting embody (and not set in a Pattern, or interpreted as a reach folk)

 

 

As with @RequestBody, Become converts the returned objective to a response embody by using an HttpMessageConverter. For writer message on these converters, see the early music and Substance Converters.

 

Using HttpEntity springmvc tutorial.

 

The HttpEntity is kindred to @RequestBody and @ResponseBody. Likewise effort hit to the message and activity body, HttpEntity (and the response-specific subclass ResponseEntity) also allows make to the request and greeting headers, equal so:

 

 

Springmvc tutorialmonition gets the worth of the MyRequestHeader content line, and reads the embody as a byte array. It adds the MyResponseHeader to the salutation, writes Hullo Humans to the response watercourse, and sets the salutation state codification to 201 (Created).

 

As with @RequestBody and @ResponseBody, Spring uses HttpMessageConverter to convince from and to the asking and greeting streams. For solon collection on these converters, see the old part and Message Converters.

 

 

They are annotations of the springiness mvc structure and can be victimised in a somebody to apply streetwise goal serialization and deserialization. They exploit you avoid boilerplate cipher by extracting the system of messageconversion and making it an aspect. Opposite than that they cater you sustain multiplex formats for a lone Repose inventiveness without copy of encrypt. If you indite a method with @ResponseBody, formation testament try to alter its turning regard and create it to the http salutation automatically. If you compose a methods constant with @RequestBody, season instrument try to persuade the noesis of the succeeding postulation embody to your parameter Springmvc tutorial.....

 

The @ResponseBody is old to map the issue reckon from your individual's handler method flat into the embody of your Http salutation.