Tagged articles
RequestBody
19 articles · Page 1 of 1
The article demonstrates how Spring Boot can automatically convert strings to enums for query and path parameters, introduces a unified StringToEnumConverterFactory, configures Jackson for case‑insensitive enum deserialization in @RequestBody, and uses a JPA AttributeConverter to persist enums, removing repetitive manual conversion code.
ConverterFactoryEnumJPA
0 likes · 8 min read

The article explains how @RequestBody binds JSON via HttpMessageConverter using Jackson, then details four frequent issues—empty bodies, extra or unknown fields, date‑format mismatches, and deep nesting causing circular serialization—and provides concrete code‑level solutions such as validation, global exception handling, Jackson configuration, and DTO usage.
DTOJacksonJavaTimeModule
0 likes · 10 min read

The article explains that @RequestBody in Spring Boot is not just a JSON deserializer but a unified HTTP request‑body entry point that can process JSON, XML, plain text, binary streams, byte arrays, form data, files and custom media types through Spring MVC's HttpMessageConverter system.
Content-TypeHttpMessageConverterRequestBody
0 likes · 12 min read

This article explains how Spring MVC’s @RequestBody annotation is a universal entry point for HTTP request bodies, supporting JSON, XML, plain text, binary streams, maps, lists, and custom media types through its HttpMessageConverter mechanism, with concrete code examples and configuration details.
Custom ConverterHttpMessageConverterJSON
0 likes · 12 min read

This guide explains why Spring MVC can read the request body only once and provides a custom solution using a RepeatReadBodyMethodProcessor and RepeatBodyHttpRequest to enable multiple @RequestBody parameters in Spring Boot 3.5.0.
HTTP requestJavaRequestBody
0 likes · 6 min read

This article explains why using a fixed DTO for a constantly changing /orders endpoint is problematic, compares simple Map and JsonNode approaches, and presents a robust polymorphic @JsonTypeInfo solution that provides type safety, IDE support, and easy extensibility.
Dynamic JSONJacksonJsonNode
0 likes · 9 min read

The article explains why Spring Boot's RequestBody can only be read once due to servlet stream constraints, and provides a complete solution using a custom HttpServletRequestWrapper and a high‑priority filter to cache and replay the body for annotations, validation, logging and other pre‑processing steps.
HttpServletRequestWrapperIdempotencyJava
0 likes · 8 min read

This article explains six key Spring Boot annotations—@RequestParam, @PathVariable, @MatrixVariable, @RequestBody, @RequestHeader, and @CookieValue—detailing how each retrieves different kinds of request data with clear code examples for building robust APIs.
@RequestHeaderCookieValueMatrixVariable
0 likes · 5 min read

This article explains six common techniques—@RequestParam, @PathVariable, @MatrixVariable, @RequestBody, @RequestHeader, and @CookieValue—for extracting request data in Spring Boot APIs, complete with concise code examples and usage guidance.
PathVariableRequestBodyRequestParam
0 likes · 4 min read

This article explains why a Spring Boot controller can read the request body only once, demonstrates wrapping multiple objects in a DTO, and provides a custom HttpServletRequestWrapper with a filter to enable multiple @RequestBody parameters while noting the performance impact.
HttpServletRequestWrapperRequestBodySpring Boot
0 likes · 6 min read

This article demonstrates three practical methods to transform the HTTP request body in a SpringBoot 3.2.5 application before it reaches the controller—using a custom Filter, a RequestBodyAdvice‑based AOP approach, and a HandlerInterceptor—complete with code examples, explanations, and testing results.
RequestBodySpringBootfilter
0 likes · 8 min read

This article explains why the Spring MVC @RequestBody annotation cannot be applied to multiple parameters in a single handler method, detailing the internal request‑body reading process, the resulting HttpMessageNotReadableException, and how to correctly handle multiple data parts using a single DTO.
BackendDTOHTTP
0 likes · 8 min read

This article explains why Spring MVC cannot parse multiple @RequestBody annotations on a single handler method, analyzes the internal I/O stream closure that causes the failure, and provides a practical solution using a request‑body caching wrapper and a servlet filter to allow repeated reads of the request payload.
BackendCachingHTTP
0 likes · 9 min read

This article demonstrates how to create a custom HttpMessageConverter in Spring Boot 2.6.12 to parse a simple “name:张三,age:20” string into a Users object, configure it in WebMvc, and explains the underlying Spring MVC request‑handling flow that invokes the converter.
Custom ConverterHttpMessageConverterRequestBody
0 likes · 8 min read

This guide explains how to implement a custom HttpMessageConverter in Spring Boot 2.5, covering the converter class, configuration, data model, controller, testing steps, and the internal request‑handling flow within the Spring MVC framework.
Custom ConverterHttpMessageConverterRequestBody
0 likes · 8 min read

This article explains why @RequestBody conflicts with Swagger in Spring Boot, outlines two common but cumbersome work‑arounds, describes a Swagger API timeout caused by Groovy's MetaClass, and provides a concise configuration fix that eliminates both the timeout and the compatibility issue.
API DocumentationGroovyRequestBody
0 likes · 4 min read

This article explains how to redesign a Spring MVC controller so that a single endpoint can seamlessly handle JSON payloads, URL‑encoded form data, and multipart file uploads by creating a custom annotation, resolver, and Spring configuration, avoiding the pitfalls of manual HttpServletRequest parsing.
Content-TypeCustom AnnotationJava
0 likes · 7 min read

This guide explains how Spring Boot automatically configures JSON libraries like Jackson, shows how to add the necessary starter, demonstrates returning JSON objects with @RestController, and illustrates receiving JSON payloads via @RequestBody with complete MockMvc test examples.
JSONJacksonJava
0 likes · 8 min read

This article explains how Spring MVC uses @RequestBody to deserialize JSON request bodies into Java objects and @ResponseBody to serialize Java objects back to JSON, providing clear code examples, curl testing, and notes on @RestController behavior.
JavaREST APIRequestBody
0 likes · 4 min read
