Tagged articles

RequestBody

17 articles · Page 1 of 1
LuTiao Programming
LuTiao Programming
May 11, 2026 · Backend Development

Why @RequestBody Is More Than Just JSON: Handling Multiple Request Formats in Spring Boot

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.

HttpMessageConverterRequestBodySpring Boot
0 likes · 12 min read
Why @RequestBody Is More Than Just JSON: Handling Multiple Request Formats in Spring Boot
LuTiao Programming
LuTiao Programming
Mar 1, 2026 · Backend Development

How to Elegantly Handle Dynamic Request Bodies in Spring Boot

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 JSONJsonNodePolymorphic Deserialization
0 likes · 9 min read
How to Elegantly Handle Dynamic Request Bodies in Spring Boot
LuTiao Programming
LuTiao Programming
Jan 8, 2026 · Backend Development

Spring Boot Advanced Trick: Proper Way to Make RequestBody Readable Multiple Times

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.

HttpServletRequestWrapperJavaRequestBody
0 likes · 8 min read
Spring Boot Advanced Trick: Proper Way to Make RequestBody Readable Multiple Times
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Dec 12, 2024 · Backend Development

How to Use Multiple @RequestBody Parameters in Spring Boot 3

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
How to Use Multiple @RequestBody Parameters in Spring Boot 3
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Apr 27, 2024 · Backend Development

Enabling Multiple @RequestBody Parameters in Spring MVC by Caching the Request Body

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.

CachingHTTPJava
0 likes · 9 min read
Enabling Multiple @RequestBody Parameters in Spring MVC by Caching the Request Body
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 24, 2023 · Backend Development

Create a Custom HttpMessageConverter in Spring Boot 2.6

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.

Backend DevelopmentHttpMessageConverterRequestBody
0 likes · 8 min read
Create a Custom HttpMessageConverter in Spring Boot 2.6
FunTester
FunTester
Oct 27, 2022 · Backend Development

How to Fix @RequestBody Compatibility and Swagger Timeout Issues in Spring Boot

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
How to Fix @RequestBody Compatibility and Swagger Timeout Issues in Spring Boot
Java Architect Essentials
Java Architect Essentials
Jun 24, 2022 · Backend Development

Make a Spring MVC Endpoint Accept JSON, Form and Multipart in One Call

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-TypeJavaRequestBody
0 likes · 7 min read
Make a Spring MVC Endpoint Accept JSON, Form and Multipart in One Call
Programmer DD
Programmer DD
Sep 16, 2018 · Backend Development

Mastering @RequestBody and @ResponseBody in Spring MVC: A Quick Guide

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.

Backend DevelopmentJavaREST API
0 likes · 4 min read
Mastering @RequestBody and @ResponseBody in Spring MVC: A Quick Guide