1, @PathVariable 方式接收URI參數。
URI如: http://localhost:8080/MyApp/123/Jack/
@GetMapping("user/{userId}/{userName}")
public String printMessage1(@PathVariable("userId") String id,@PathVariable("userName") String name) {
}
2,@RequestParam的方式接收URI參數。
URI如: http://localhost:8080/MyApp?date=12-05-2013
@GetMapping
public String printMessage1(@RequestParam("date") String theDate) {
}
ps:@RequestBody不屬於GET的接收參數方式。