-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
matthias boehmer opened SPR-6559 and commented
I have a controller with a method returning a simple string that contains a JSON object. The HttpServletRespose is avaiable as a method parameter. When I try to set the content type of the response to "application/json" is gets overwritten when I use @ResponseBody for mapping the return value to the response. It works well when I set the return type to void and write the response body directly into the HttpServletResponse using response.getWriter().write(jsonString).
Should not it be possible to set the content type, when I use @ResponseBody? This might be a bug, or at least it should be documented that @ResponseBody implicitly sets the content type.
Issue Links:
- @ResponseBody doesn't obey CharacterEncodingFilter [SPR-6443] #11109
@ResponseBodydoesn't obey CharacterEncodingFilter - Explicitly set response Content-Type in @ResponseBody [SPR-6702] #11368 Explicitly set response Content-Type in
@ResponseBody
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply