Top Description Methods
org.springframework.web.bind.annotation

public @Interface RequestBody

extends Annotation
Annotations
@Target:PARAMETER
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.springframework.http.converter.HttpMessageConverter

Annotation indicating a method parameter should be bound to the body of the web request. The body of the request is passed through an HttpMessageConverter to resolve the method argument depending on the content type of the request. Optionally, automatic validation can be applied by annotating the argument with @Valid.

Supported for annotated handler methods.

Author
Arjen Poutsma
Since
3.0
See Also
RequestHeader, ResponseBody, org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter

Method Summary

Modifier and TypeMethod and Description
public boolean
required()

Whether body content is required.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

requiredback to summary
public boolean required()

Whether body content is required.

Default is true, leading to an exception thrown in case there is no body content. Switch this to false if you prefer null to be passed when the body content is null.

Since
3.2