Using Map<String, String> with @PathVariable

Is that map populated with all path variable names and values?

Cheav Sovannarith
Java Epic
1 min readOct 30, 2019

--

@PathVariable is a Spring annotation which indicates that a method parameter should be bound to a URI template variable. If the method parameter is Map<String, String> then the map is populated with all path variable names and values.

It has the following optional elements:

  • name — name of the path variable to bind to
  • required — tells whether the path variable is required
  • value — alias for name

Doc : http://zetcode.com/spring/pathvariable/

--

--