HttpServletResponse
Learn HttpServletResponse (Request Handling, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes HttpServletResponse ( jakarta.servlet.http ) represents the outgoing response: status code, headers, cookies and the body stream or writer. Spring injects it when it is a controller parameter, letting you write the response yourself. Use it rarely : return values, ResponseEntity and @ResponseStatus are cleaner for most responses.