Request Mapping Annotations
Learn Request Mapping Annotations (REST API Development, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
What Request Mapping Does When a request arrives, Spring MVC has to decide which controller method handles it. It matches on the URL path and the HTTP method (and optionally headers, parameters and content types). The annotation that declares that match is @RequestMapping . The five shortcut annotations are exactly @RequestMapping with the method filled in. Use the shortcuts on methods; keep @RequestMapping for the class , where it sets a shared prefix.
More lessons in REST API Development
- REST API & RESTful Web Services
- HTTP Methods
- HTTP Status Codes
- Building REST APIs with Spring Boot
- Reading Request Data
- ResponseEntity
- DTOs: Request and Response
- API Design - Pagination, Filtering & Versioning
- JSON - Structure & Parsing
- REST API - Save & Update Operation
- REST API - Get & Delete Operation
- Spring Boot - Interceptor
- Mini Project: Book Catalogue REST API