What Is @ResponseStatus in Spring Boot? Usage and Differences from ResponseStatusException
A beginner-friendly explanation of what @ResponseStatus is in Spring Boot. Learn how to apply it in three places (controller methods, exception classes, and @ExceptionHandler) with code examples for returning 201, 204, and 404, plus a decision table for choosing between ResponseStatusException, ResponseEntity, and ProblemDetail. Also covers why adding reason removes the JSON body, why message is not shown in Spring Boot 2.3 and later, including 3.x (server.error.include-message), what to do when @ResponseStatus does not work, and how to verify behavior with MockMvc.