@RestController
Learn @RestController (REST API with Spring MVC, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes @RestController is a stereotype annotation equal to @Controller plus @ResponseBody on every method. Effect : return values are written to the HTTP response body through message converters, never resolved as a view name. Component scanning registers it as a bean, so it also works with constructor injection.
More lessons in REST API with Spring MVC
- REST Architecture
- RESTful API Design
- REST Controller
- JSON Request
- JSON Response
- Jackson
- ObjectMapper
- JSON Serialization
- JSON Deserialization
- HttpMessageConverter
- MappingJackson2HttpMessageConverter
- ResponseEntity
- HTTP Status Codes
- API Versioning
- REST API Best Practices
- Mini Project: REST Details: PUT vs PATCH, Pagination, ETag and Allowed Methods