Request Mapping
Learn Request Mapping (Controllers, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes @RequestMapping is the core Spring MVC annotation that maps requests to a class or a method; it can be placed at class level and at method level. Attributes : value or path (URL), method , params , headers , consumes and produces . Shortcuts : the composed annotations such as @GetMapping are just @RequestMapping(method = GET) with a shorter name.
More lessons in Controllers
- @Controller
- @RestController
- Controller Lifecycle
- Controller Methods
- @RequestMapping
- @GetMapping
- @PostMapping
- @PutMapping
- @DeleteMapping
- @PatchMapping
- Mapping HTTP Methods
- Mapping URL Paths
- Class-Level Mapping
- Method-Level Mapping
- Multiple URL Mappings
- Consumes
- Produces
- Mini Project: Controller Types and Mapping Rules