Browse Source

Improve error message for missing request body

Issue: SPR-12888
pull/770/merge
Rossen Stoyanchev 10 years ago
parent
commit
13403d51e5
  1. 3
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java

3
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java

@ -147,7 +147,8 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter @@ -147,7 +147,8 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter
Object arg = readWithMessageConverters(inputMessage, methodParam, paramType);
if (arg == null) {
if (methodParam.getParameterAnnotation(RequestBody.class).required()) {
throw new HttpMessageNotReadableException("Required request body is missing: " + methodParam);
throw new HttpMessageNotReadableException("Required request body is missing: " +
methodParam.getMethod().toGenericString());
}
}

Loading…
Cancel
Save