Skip to main content

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