Controller Layer (Web & REST Controllers)
About
1. Core Controller Annotations
@Controller
@Controller@Controller
public class MyController {
@GetMapping("/home")
public String home() {
return "home"; // Returns a view name
}
}@RestController
@RestController2. Request Mapping Annotations
@RequestMapping
@RequestMappingShortcuts for @RequestMapping
@RequestMappingAnnotation
Purpose
@GetMapping
@GetMapping@PostMapping
@PostMapping@PutMapping
@PutMapping@DeleteMapping
@DeleteMapping@PatchMapping
@PatchMappingLast updated