path variable

A placeholder segment in a route, such as {id} in /orders/{id}, whose value is taken from the request URL.

In more detail

In Spring, @PathVariable binds that segment to a method parameter and converts it to the parameter's type. A path variable should identify a resource and have one clear meaning and validation rule.

Example

String one(@PathVariable String id)

Related terms

Taught in

References