Skip to content

Instantly share code, notes, and snippets.

@AlexCzar
Last active December 26, 2015 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexCzar/e0ba8f82c4317733e210 to your computer and use it in GitHub Desktop.
Save AlexCzar/e0ba8f82c4317733e210 to your computer and use it in GitHub Desktop.
I'm using Spring 3.2.4 Application uses JavaConfig, more specifically I use WebMvcConfigurationSupport as configuration base. URL I'm trying is http://localhost:8080/matrix/coords;lat=44.1;lon=44.2 Relevant log record: ServletRequestBindingException: Missing matrix variable 'lat' for method parameter type [double]
@Controller
public class MatrixController {
// URL I'm trying is http://localhost:8080/matrix/coords;lat=44.1;lon=44.2
@RequestMapping(method = RequestMethod.GET, value = "/matrix/{coords}")
public ResponseEntity<Location> getLocationByCoordinates(@PathVariable String coords,
@MatrixVariable(value = "lat") double lat,
@MatrixVariable(value = "lon") double lon) {
// processing
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment