Produces
Learn Produces (Controllers, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes produces is a mapping condition that declares the media type a handler returns, such as produces = "application/json" . Content negotiation : Spring compares the request Accept header with produces ; no match gives 406 Not Acceptable . Response header : the chosen type is written into the response Content-Type .
More lessons in Controllers
- @Controller
- @RestController
- Controller Lifecycle
- Controller Methods
- Request Mapping
- @RequestMapping
- @GetMapping
- @PostMapping
- @PutMapping
- @DeleteMapping
- @PatchMapping
- Mapping HTTP Methods
- Mapping URL Paths
- Class-Level Mapping
- Method-Level Mapping
- Multiple URL Mappings
- Consumes
- Mini Project: Controller Types and Mapping Rules