Tagged articles
5 articles
Page 1 of 1
JD Cloud Developers
JD Cloud Developers
Dec 12, 2023 · Backend Development

Why @ResponseBody Fails When Writing Directly to the Output Stream in Spring

This article analyzes a Spring MVC issue where a batch template download failed due to missing configuration, explores how @ResponseBody interacts with manual stream writes, presents code examples, debugging insights, and offers best‑practice recommendations for reliable file‑download endpoints.

FileDownloadJavaResponseBody
0 likes · 5 min read
Why @ResponseBody Fails When Writing Directly to the Output Stream in Spring
Java Architecture Diary
Java Architecture Diary
Apr 13, 2020 · Backend Development

What Determines @ResponseBody’s Default Return Format in Spring MVC?

In Spring MVC, the default data format returned by @ResponseBody depends on the client’s Accept header, and the framework selects an appropriate HttpMessageConverter through RequestResponseBodyMethodProcessor, which evaluates acceptable and producible media types to produce JSON, XML, or other formats.

Accept HeaderHttpMessageConverterJava
0 likes · 5 min read
What Determines @ResponseBody’s Default Return Format in Spring MVC?
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.

@RequestBodyBackend DevelopmentJava
0 likes · 4 min read
Mastering @RequestBody and @ResponseBody in Spring MVC: A Quick Guide