Tag

RequestBody

0 views collected around this technical thread.

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.

FilterHttpServletRequestWrapperJava
0 likes · 6 min read
How to Use Multiple @RequestBody Parameters in Spring Boot 3
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Aug 24, 2024 · Backend Development

Modifying SpringBoot Request Body with Filters, AOP, and Interceptors

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.

AOPFilterInterceptor
0 likes · 8 min read
Modifying SpringBoot Request Body with Filters, AOP, and Interceptors
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jun 14, 2024 · Backend Development

Why @RequestBody Cannot Be Used Multiple Times in a Spring MVC Method – A Deep Dive

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.

AnnotationDTOHTTP
0 likes · 8 min read
Why @RequestBody Cannot Be Used Multiple Times in a Spring MVC Method – A Deep Dive
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.

CachingFilterHTTP
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 DevelopmentCustom ConverterHttpMessageConverter
0 likes · 8 min read
Create a Custom HttpMessageConverter in Spring Boot 2.6
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Aug 26, 2023 · Backend Development

How to Build a Custom HttpMessageConverter in Spring Boot 2.5

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.

Backend DevelopmentCustom ConverterHttpMessageConverter
0 likes · 8 min read
How to Build a Custom HttpMessageConverter in Spring Boot 2.5