- register.php?age=30와 같은 URL 형식인 경우, @RequestParam 어노테이션을 사용할 것
@GetMapping
public boolean register(@RequestParam("age") int age) {
// ...
}
- /persons/findbyage/와 같은 URL 형식인 경우, @PathVariable 어노테이션을 사용할 것
@GetMapping("/persons/findbyage/{age}")
public boolean findByAge(@PathVariable("age") int age) {
// ...
}