Content-type and @ResponseBody in spring
<p>It could be very simple but it will be very helpful for me to understand...</p>

<p>I used @ResponseBody in my restcontroller to return String value to browser. The response string is successfully received in browser.</p>

<p>ie:</p>

<pre><code>@RequestMapping(value="/foo", method=RequestMethod.GET)
@ResponseBody
public String foo() {
    return "bar";
}
</code></pre>

<p>What is the content-type of above response? If this is going to be like writing setAttribute in servlet response what could the attribute name? </p>

<p>If the browser accept only "application/json" how spring will treat the response? </p>