所有查询参数将通过使用
&字符的拆分自动从url中提取,并映射到方法声明中的相应@RequestParam。因此,您无需在@RequestMapping注释中指定所有键,而在此处仅应指定端点值。
为了使您的示例正常工作,您只需要将其余端点更改为
@RequestMapping(method=RequestMethod.GET)GoogleMatrixResult process(@RequestParam(value="key") String key, @RequestParam(value="origins") String origins, @RequestParam(value="destinations") String destinations);



