The {foo}
part in a @RequestMapping
value is a path variable which means a value retrieved from the url path and not from a request parameter.
For example if the user access to /files/foo.zip
, then {id}
will match foo.zip
and you tell Spring to store that value into the variable that has the annotation @PathVariable("id")
.
You can have multiple path variable in a URL identifier of a @RequestMapping
annotation value, and you can inject these values into a variables by using @PathVariable
with the same id you used inside the curly brackets.