Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring RestTemplate URL没有足够的变量值可用于展开_Spring_Web Services_Rest_Restful Url_Resttemplate - Fatal编程技术网

Spring RestTemplate URL没有足够的变量值可用于展开

Spring RestTemplate URL没有足够的变量值可用于展开,spring,web-services,rest,restful-url,resttemplate,Spring,Web Services,Rest,Restful Url,Resttemplate,我需要向RESTURL传递2个参数。像这样: 我正在尝试这样的事情,这显然是不正确的。请帮助: restTemplate.getForObject(localUrl+"{userName}"+"/"+"{id}", Details.class); 编辑: 我也厌倦了这一点,但同样的错误是: String param = "{userName}/{id}"; restTemplate.getForObject(localUrl+param, Details.class); 谢谢 哈里什

我需要向RESTURL传递2个参数。像这样:

我正在尝试这样的事情,这显然是不正确的。请帮助:

restTemplate.getForObject(localUrl+"{userName}"+"/"+"{id}", Details.class);
编辑:

我也厌倦了这一点,但同样的错误是:

String param = "{userName}/{id}";
restTemplate.getForObject(localUrl+param, Details.class);
谢谢

哈里什