Is the class passed as a parameter in the controller method and marked with the annotation @RequestBodyneeded to implement the interface Serializable?
@RequestBody
Serializable
I have the same question for a return value class marked with annotation @ResponseBody.
@ResponseBody
I will also be very grateful for an explanation of why the interface Serializableis or is not required.
. , @ResponseBody, , JSON, . Java, Serializable.
@RequestBody @ResponseBody RequestResponseBodyMethodProcessor, HttpMessageConverter , , JSON JSON .
RequestResponseBodyMethodProcessor
HttpMessageConverter
HttpMessageConverter, canRead, : boolean canRead(Class<?> clazz, MediaType mediaType); , , .
canRead
boolean canRead(Class<?> clazz, MediaType mediaType);