SPR-6214 - Using @ResponseBody throws HttpMediaTypeNotAcceptableException when it supports writing an acceptable MediaType

This commit is contained in:
Arjen Poutsma
2009-10-14 10:46:29 +00:00
parent 0f06771249
commit 5310035700
2 changed files with 15 additions and 1 deletions

View File

@@ -789,7 +789,7 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator implemen
for (Object o : messageConverter.getSupportedMediaTypes()) {
MediaType supportedMediaType = (MediaType) o;
for (MediaType acceptedMediaType : acceptedMediaTypes) {
if (supportedMediaType.includes(acceptedMediaType)) {
if (acceptedMediaType.includes(supportedMediaType)) {
messageConverter.write(returnValue, outputMessage);
this.responseArgumentUsed = true;
return;